I create one seed per set (N sets identified by gNum), DISTRIBUTE them by  gNum. Then populate and SORT by rnd locally before the sample.

NxKoutofM(t_count N, t_FieldNumber K, t_FieldNumber M) := FUNCTION
	rndFeatRec:= RECORD
		t_count	      gNum   :=0;
		t_FieldNumber number :=0;
		t_FieldReal   rnd    :=0;
	END;
	seed:= DATASET([{0,0,0}], rndFeatRec);
	group_seed:= DISTRIBUTE(NORMALIZE(seed, N,TRANSFORM(rndFeatRec, SELF.gNum:= COUNTER)), gNum);
	allFields:= NORMALIZE(group_seed, M, TRANSFORM(rndFeatRec, SELF.number:= (COUNTER % M) +1, SELF.rnd:=RANDOM(), SELF:=LEFT),LOCAL);
	allSorted:= SORT(allFields, gNum, rnd, LOCAL);
	raw_set:= ENTH(allSorted, K, M, 1);
	RETURN TABLE(raw_set, {gNum, number});
END;