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.
Copy Questionnaire ID from PFF file
-
khurshid.arshad
- Posts: 618
- Joined: July 9th, 2012, 11:32 am
- Location: Islamabad, Pakistan
-
Guest
Re: Copy Questionnaire ID from PFF file
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
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
-
kakinyim
- Posts: 42
- Joined: January 16th, 2012, 6:38 am
- Location: Remote/Virtual
Re: Copy Questionnaire ID from PFF file
Arshad,
I forgot to login.
Mutua
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
-
khurshid.arshad
- Posts: 618
- Joined: July 9th, 2012, 11:32 am
- Location: Islamabad, Pakistan
Re: Copy Questionnaire ID from PFF file
Dear Mutua
It works and thank you for your help.
Regards.
a.
It works and thank you for your help.
Regards.
a.
-
Gregory Martin
- Posts: 1947
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: Copy Questionnaire ID from PFF file
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.
-
khurshid.arshad
- Posts: 618
- Joined: July 9th, 2012, 11:32 am
- Location: Islamabad, Pakistan
Re: Copy Questionnaire ID from PFF file
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.
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.
-
Gregory Martin
- Posts: 1947
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: Copy Questionnaire ID from PFF file
What exactly are you trying to do with MySQL?