Write Case Function

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
prabhustat
Posts: 72
Joined: March 17th, 2012, 10:46 am

Write Case Function

Post by prabhustat »

Hi

I want to a write external data case file from a roster data as a single case file. Anyone please share the example.

Thanks in advance.

PP
Gregory Martin
Posts: 1783
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Write Case Function

Post by Gregory Martin »

You'll have to add more details if you want someone to post an example that is useful. Perhaps you can post your dictionaries and indicate what you are trying to do.

Writecase simply saves what is loaded into your variables, so you will want to execute some logic commands to get the right data into memory. For example, if I had a roster with two variables, SEX and AGE, and I wanted to save separate cases for each person, my code might look like this:
do numeric counter = 1 while counter <= count(SEX)

    EXT_DICT_HHID = HHID;
    EXT_DICT_PERSON_ID = counter;
    EXT_DICT_SEX = SEX(counter);
    EXT_DICT_AGE = AGE(counter);
   
writecase(EXT_DICT_AGE);

enddo;
Post Reply