Page 1 of 1

Data downloads not working

Posted: August 8th, 2018, 4:12 pm
by Don
I'm trying to download data that is restricted to a particular ED to my tablet. I'm using the following code and although I'm not seeing any errors I'm not seeing any new cases on the tablet. Is there something that I am missing?

Code: Select all

PROC CHOOSE_ED
Postproc
	//there's a CHOOSE_ROUND field that is filled before this one
	rnd_ed = maketext("%02d%03d", CHOOSE_ROUND,CHOOSE_ED);
	downloadData(rnd_ed);
	
	move to LOGIN;

Code: Select all

//downloads Data based on round and ED
function downloadData(string rnd_edno)
	errmsg("Attempting to download all data from Round %s, ED %s",rnd_edno[1:2],rnd_edno[3:3]);
	if syncconnect(FTP,"1.1.1.1","username","password") then		//connect to FTP 
		syncdata(GET,LABOURFORCE_DICT,rnd_edno);		//get labourforce data for round and ED
		syncdata(GET,LISTING_DICT,rnd_edno);			//get listing data for round and ED
		syncdisconnect();		//disconnect
		errmsg("Download of round %s, ED %s was successful",rnd_edno[1:2],rnd_edno[3:3]);
	else
		errmsg("Download of round %s, ED %s failed, Please try again",rnd_edno[1:2],rnd_edno[3:3]);
	endif;
end;

Re: Data downloads not working

Posted: August 8th, 2018, 4:56 pm
by josh
Most likely cause is that the universe you are passing to syncdata() does not match any cases on the server. You can verify that this is the issue by removing the universe paramrter and running your program to see if you get data.

You need to make sure that number of digits in the id-items and the zero fill of the id items are consistent between your universe and your dictionary. If the id-items are not zero-filled in your dictionary then it won't match the zero fill you have in your universe and no cases will be synced. Same issue if your id-items are not 2 and 3 digits.

Re: Data downloads not working

Posted: August 8th, 2018, 5:33 pm
by Don
Hi Josh,

Thanks. The issue was that I was using %02d and I didn't zero fill my data dictionary.