Data downloads not working

Discussions about syncing data via Bluetooth, Dropbox, FTP, and using CSWeb
Don
Posts: 35
Joined: February 15th, 2013, 1:28 pm
Location: Barbados
Contact:

Data downloads not working

Postby Don » August 8th, 2018, 4:12 pm

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;

josh
Posts: 1651
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Data downloads not working

Postby josh » August 8th, 2018, 4:56 pm

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.

Don
Posts: 35
Joined: February 15th, 2013, 1:28 pm
Location: Barbados
Contact:

Re: Data downloads not working

Postby Don » August 8th, 2018, 5:33 pm

Hi Josh,

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


Return to “Synchronization”