Page 1 of 1
Copy Questionnaire ID from PFF file
Posted: January 19th, 2014, 9:52 am
by khurshid.arshad
Dear Gregory
I hope you are doing well. I am working on pff and I have a few questions on it.
I am working on the menu and these are the following variables.
• KPO Name, KPO ID, Questionnaire ID and type of questionnaire
In the menu I am creating a pff file for the following type of questionnaires:
Head Questionnaire; Male Questionnaire, Female Questionnaire and Child Questionnaire;
I have already saved the Questionnaire IDs in my selected pff file. For instance
I am going to enter data in Head questionnaire and I will type 1 in “Type of questionnaire” variable in menu.
filewrite(pffFile,"[DataEntryIDs]");
filewrite(pffFile,"Questionnaire_ID=%d",Questionnaire_ID);
Now my question is what can I do to automatically make the questionnaire id come up from the pff file when I open the head questionnaire?
My one variable is “Concent” which is on every first form in each questionnaire. If the answer is refused (2) then I want to save my data and reopen my menu pff file.
If Census Bureau is going to conduct training for advance level then please block 1 to 2 days only for Interface CSPro with MySQL database. (Request)
Thanks.
a.
Re: Copy Questionnaire ID from PFF file
Posted: January 22nd, 2014, 10:36 am
by Guest
Hi Arshad,
Nice to see your request. How is Pakistan?
As you wait for Greg's reply, I wish to share with you I how I do this.
First, I have two applications. One writes a PFF file and I insert parameters in the file. On the other application, I use sysparm() to read these parameters. Thats all. Check this example I have pasted here below:
================
Program A:
...
function writePFF (alpha (20) user, alpha (50) dataFile, alpha (1) clicked); //writePFF(myCluster, form, choice);
// writePFF (myKeyer, form, prefix);
{
Copy all files reference in .ENT, and .FMF files
}
setFile(PFF_File,concat(strip(server),strip(pffFolder),strip(form),strip("_"),strip(myCluster),strip("_"), strip(prefix),strip(".pff")));
fileDelete(PFF_File);
fileWrite(PFF_File,"[Run Information]");
fileWrite(PFF_File,"Version=CSPro 5.0.3");
fileWrite(PFF_File,"AppType=Entry");
fileWrite(PFF_File," ");
fileWrite(PFF_File,"[DataEntryInit]");
fileWrite(PFF_File,concat("OperatorID=",user));
fileWrite(PFF_File,"Interactive=Ask");
fileWrite(PFF_File," ");
fileWrite(PFF_File,"[Files]");
fileWrite(PFF_File,concat(strip("Application="), strip(dir_Back), strip(server), strip(dir_Back), strip(dataFile),strip(dir_Back), strip(dataFile),strip(".ent")));
// fileWrite(PFF_File,concat(strip("Application="), strip(server), strip(dir_Back), strip(dataFile),strip(dir_Back), strip(dataFile),strip(".ent")));
writeFile = concat("WriteData=",strip(defaultPathFile));
if clicked="M" then { if main data not on network }
fileWrite(PFF_File,concat(strip("InputData="), strip(dir_Back), strip(server), strip(dir_Back), strip(dir_Data),strip(dir_Back),STRIP("APRM"),strip("_"),strip(myCluster), strip("_"), strip(prefix), strip(".DAT")));
fileWrite(PFF_File, writeFile);
elseif clicked="V" then
fileWrite(PFF_File,concat(strip("InputData="), strip(dir_Back), strip(server), strip(dir_Back), strip(dir_VData),strip(dir_Back),strip("APRM"),strip("_"),strip(myCluster), strip("_"),strip(prefix), strip(".DAT")));
fileWrite(PFF_File, writeFile);
endif;
fileWrite(PFF_File," ");
fileWrite(PFF_File,"[ExternalFiles]");
fileWrite(PFF_File,concat(strip("cluster="), strip(dir_Back), strip(server),strip(dir_Back),strip(dir_LookUp),strip(dir_Back),strip("cluster.dat")));
fileWrite(PFF_File," ");
fileWrite(PFF_File,"[Parameters]");
fileWrite(PFF_File,concat(strip("Parameter="),strip(myCluster),strip(houseNumber),strip(username)));
\\Parameter=0938003MARIA01
close(PFF_File);
end;
Program B:
{Application 'APRM_DATA_ENTRY' logic file generated by CSPro}
PROC GLOBAL
alpha (14) myparameter;
PROC APRM_DATA_DICT_FF
PROC HH02
preproc
myparameter = sysparm();
LookUpCluster = myParameter[1:4]; // Cluster
myHousehold = myParameter[5:3]; // Household number
KEYER_CODE = myParameter[8:7]; // Keyer
================
If not clear, we can link up thru emails.
Mutua
Re: Copy Questionnaire ID from PFF file
Posted: January 22nd, 2014, 2:17 pm
by kakinyim
Arshad,
I forgot to login.
Mutua
Guest wrote:Hi Arshad,
Nice to see your request. How is Pakistan?
As you wait for Greg's reply, I wish to share with you I how I do this.
First, I have two applications. One writes a PFF file and I insert parameters in the file. On the other application, I use sysparm() to read these parameters. Thats all. Check this example I have pasted here below:
================
Program A:
...
function writePFF (alpha (20) user, alpha (50) dataFile, alpha (1) clicked); //writePFF(myCluster, form, choice);
// writePFF (myKeyer, form, prefix);
{
Copy all files reference in .ENT, and .FMF files
}
setFile(PFF_File,concat(strip(server),strip(pffFolder),strip(form),strip("_"),strip(myCluster),strip("_"), strip(prefix),strip(".pff")));
fileDelete(PFF_File);
fileWrite(PFF_File,"[Run Information]");
fileWrite(PFF_File,"Version=CSPro 5.0.3");
fileWrite(PFF_File,"AppType=Entry");
fileWrite(PFF_File," ");
fileWrite(PFF_File,"[DataEntryInit]");
fileWrite(PFF_File,concat("OperatorID=",user));
fileWrite(PFF_File,"Interactive=Ask");
fileWrite(PFF_File," ");
fileWrite(PFF_File,"[Files]");
fileWrite(PFF_File,concat(strip("Application="), strip(dir_Back), strip(server), strip(dir_Back), strip(dataFile),strip(dir_Back), strip(dataFile),strip(".ent")));
// fileWrite(PFF_File,concat(strip("Application="), strip(server), strip(dir_Back), strip(dataFile),strip(dir_Back), strip(dataFile),strip(".ent")));
writeFile = concat("WriteData=",strip(defaultPathFile));
if clicked="M" then { if main data not on network }
fileWrite(PFF_File,concat(strip("InputData="), strip(dir_Back), strip(server), strip(dir_Back), strip(dir_Data),strip(dir_Back),STRIP("APRM"),strip("_"),strip(myCluster), strip("_"), strip(prefix), strip(".DAT")));
fileWrite(PFF_File, writeFile);
elseif clicked="V" then
fileWrite(PFF_File,concat(strip("InputData="), strip(dir_Back), strip(server), strip(dir_Back), strip(dir_VData),strip(dir_Back),strip("APRM"),strip("_"),strip(myCluster), strip("_"),strip(prefix), strip(".DAT")));
fileWrite(PFF_File, writeFile);
endif;
fileWrite(PFF_File," ");
fileWrite(PFF_File,"[ExternalFiles]");
fileWrite(PFF_File,concat(strip("cluster="), strip(dir_Back), strip(server),strip(dir_Back),strip(dir_LookUp),strip(dir_Back),strip("cluster.dat")));
fileWrite(PFF_File," ");
fileWrite(PFF_File,"[Parameters]");
fileWrite(PFF_File,concat(strip("Parameter="),strip(myCluster),strip(houseNumber),strip(username)));
\\Parameter=0938003MARIA01
close(PFF_File);
end;
Program B:
{Application 'APRM_DATA_ENTRY' logic file generated by CSPro}
PROC GLOBAL
alpha (14) myparameter;
PROC APRM_DATA_DICT_FF
PROC HH02
preproc
myparameter = sysparm();
LookUpCluster = myParameter[1:4]; // Cluster
myHousehold = myParameter[5:3]; // Household number
KEYER_CODE = myParameter[8:7]; // Keyer
================
If not clear, we can link up thru emails.
Mutua
Re: Copy Questionnaire ID from PFF file
Posted: January 23rd, 2014, 12:06 pm
by khurshid.arshad
Dear Mutua
It works and thank you for your help.
Regards.
a.
Re: Copy Questionnaire ID from PFF file
Posted: February 18th, 2014, 11:49 pm
by Gregory Martin
Generally people do pass parameters through the PFF file as Mutua showed. Another option, less used, is to use a lookup file to pass around parameters. The one program will writecase the parameters, and then next program will pick up the parameters using a loadcase statement. This can be useful it you have a many parameters to pass.
Re: Copy Questionnaire ID from PFF file
Posted: February 23rd, 2014, 4:57 am
by khurshid.arshad
Dear Gregory
After a long time i see your responses. I hope you are doing well. I want to know how we can use parameter through PFF file.
It will be very good for me and for all others that if you can upload a video clip that how we can work with MYSQLAdapter which you have mentioned in your last training.
If you are planning to conduct training for advance level please spare one day for MYSQLAdapter.
Regards.
a.
Re: Copy Questionnaire ID from PFF file
Posted: February 25th, 2014, 7:20 am
by Gregory Martin
What exactly are you trying to do with MySQL?