h_1 = WndCreat ([], "Sample Step", [NaN,NaN,416,152], 2);

CtrCreat (h_1, 510, [9,10,200,13], "Name of the data file with population");
h_2 = CtrCreat (h_1, 410, [9,24,320,20], "");
CtrCreat (h_1, 110, [334,24,58,20], "Browse ...","f=FileOpenDialog(h_1);if (strlen(f));CtrSet(h_2,f);end;");

CtrCreat (h_1, 510, [9,50,240,13], "Name of the data file with sample specification");
h_3 = CtrCreat (h_1, 410, [9,64,320,20], "");
CtrCreat (h_1, 110, [334,64,58,20], "Browse ...","f=FileOpenDialog(h_1);if (strlen(f));CtrSet(h_3,f);end;");

CtrCreat (h_1, 110, [228,95,48,23], "OK","nf1 = CtrGet(h_2);nf2 = CtrGet(h_3);if (strlen(nf1) & strlen(nf2));WndClose(h_1);sstep_m1;end;");
CtrCreat (h_1, 110, [281,95,48,23], "Cancel","WndClose(h_1);");



global macro sstep_m1
	DataOpen(nf2);
	ty = DataVarType()==1;
	uzr_m = sum(ty);
	ty = find(ty);
	Uzorak = Data(:,ty);
	uzrvar=GetVarName(ty);
	
	DataOpen(nf1) %dodati koji fajl
	popvar=GetVarName(1:nvar);
	pop_m = nvar;
	
	c=zeros(pop_m,1);
	for i=1:pop_m
		c(i)=sum(~strcmp(popvar(i), uzrvar));
	end
	c=find(c);
	if c~=[]
		zajedvar = popvar(c);
		popvar(c)=[];
		k=1:pop_m;
		k(c)=[];
	else
		error("Nema istih varijabli u uzorku i populaciji");
	end
	
	c=zeros(uzr_m,1);
	for i=1:uzr_m
		c(i)=sum(~strcmp(uzrvar(i), zajedvar));
	end
	c=find(c);
	uzrvar_=uzrvar;
	uzrvar_(c)=[];
	k=1:uzr_m;
	k(c)=[];
	
	sstep_w2
end