LOOK-UP FILE not working properly
Posted: February 9th, 2016, 7:29 am
Dear CSPro users,
I have a question regarding the look up file. I emailed this question to csprousers@gmail.com too, so sorry for any potential "cross-posting".
In my program I have a Rwand_DICT (main follow_up program) and a BASELINEDATA_DICT (baseline data look up data). This BASELINEDATA_DICT is identical to my baseline.dat file (which I created from an Excel file with help of the BASELINEDATA_DICT and the Excel to Cspro tool). In my case there are no spaces between the 3 baseline variables, but there lenght and position match the BASELINEDATA_DICT. I browsed this BASELINEDATA_DICT in notepad and made sure that it indeed looks the same as the dictionary in my program.
In BASELINEDATA_DICT I have one Id item (HHID_OLD) and two record items (IDCX_OLD and NAME_OLD).
Now what I want and what doesn't work is the following:
The first question in the program is the HHID (located in "master" Rwand_DICT, called HHID, also an Id item). After the interviewer enters this HHID I want either one of the following:
i) an error message saying that this household did not exist in the baseline survey (if HHID does not exist in BASELINEDATA_DICT)
ii) a pop up with the names of the individuals within this household at baseline (if HHID does exist in BASELINEDATA_DICT)
I only got till part i) where I run into the following problem: it doesn't matter whether I fill in a correct or an incorrect HHID; in all cases it says that this HHID didn't exist in the baseline survey.
I used the following logic @ HHID:
PROC HHID
postproc
HHID_OLD=HHID;
OLD_CASE=loadcase(BASELINEDATA_DICT,HHID_OLD);
if not OLD_CASE then
errmsg("INTERVIEWER: HHID DID NOT EXIST IN 2014 SURVEY");
reenter;
endif;
Where OLD_CASE was declared earlier as numeric.
Would you be able and willing to help me? Of course I would be happy to sent you my program or any other files.
Either way, thank you very much!
Greetings,
Daniella
I have a question regarding the look up file. I emailed this question to csprousers@gmail.com too, so sorry for any potential "cross-posting".
In my program I have a Rwand_DICT (main follow_up program) and a BASELINEDATA_DICT (baseline data look up data). This BASELINEDATA_DICT is identical to my baseline.dat file (which I created from an Excel file with help of the BASELINEDATA_DICT and the Excel to Cspro tool). In my case there are no spaces between the 3 baseline variables, but there lenght and position match the BASELINEDATA_DICT. I browsed this BASELINEDATA_DICT in notepad and made sure that it indeed looks the same as the dictionary in my program.
In BASELINEDATA_DICT I have one Id item (HHID_OLD) and two record items (IDCX_OLD and NAME_OLD).
Now what I want and what doesn't work is the following:
The first question in the program is the HHID (located in "master" Rwand_DICT, called HHID, also an Id item). After the interviewer enters this HHID I want either one of the following:
i) an error message saying that this household did not exist in the baseline survey (if HHID does not exist in BASELINEDATA_DICT)
ii) a pop up with the names of the individuals within this household at baseline (if HHID does exist in BASELINEDATA_DICT)
I only got till part i) where I run into the following problem: it doesn't matter whether I fill in a correct or an incorrect HHID; in all cases it says that this HHID didn't exist in the baseline survey.
I used the following logic @ HHID:
PROC HHID
postproc
HHID_OLD=HHID;
OLD_CASE=loadcase(BASELINEDATA_DICT,HHID_OLD);
if not OLD_CASE then
errmsg("INTERVIEWER: HHID DID NOT EXIST IN 2014 SURVEY");
reenter;
endif;
Where OLD_CASE was declared earlier as numeric.
Would you be able and willing to help me? Of course I would be happy to sent you my program or any other files.
Either way, thank you very much!
Greetings,
Daniella