Page 1 of 1

labels of the occurrences

Posted: September 17th, 2021, 12:53 pm
by Maria kaab
Hello,
I have a table with 4 columns, the first column "Name" must be filled in with all the names that were mentioned in the previous questions (friends, neighbors, colleagues and family). In each question, we have 3 occ. By doing the following: PROC NAME onfocus $ = (FRIENDS (curocc ()); The first column is filled with the names of the 3 friends, I don't know how to add the names of neighbors, family and colleagues? Can you help me ?

Re: labels of the occurrences

Posted: September 17th, 2021, 5:27 pm
by sherrell
Hi Maria,

The following assumes you have a repeating record named ROSTER that repeats 12 times, and that ROSTER contains 4 variables: NAME, Q1, Q2, and Q3. All the "name" fields (friends, family, etc) should have the same defined length in the DCF (for ex, alpha 15).
PROC ROSTER000
preproc
// the following logic has to be in the preproc to work, onfocus won't work
// pull names from friends, neighbors, colleagues and family rosters to build name roster

numeric i=1, j, maxJ;

    maxJ =
count(FRIENDS000);
   
do j=1 while j <= maxJ
        NAME(i) = FRIENDS(j);
inc(i);
   
enddo;

    maxJ =
count(NEIGHBORS);
   
do j=1 while j <= maxJ
        NAME(i) = NEIGHBORS(j);
inc(i);
   
enddo;

    maxJ =
count(COLLEAGUES);
   
do j=1 while j <= maxJ
        NAME(i) = COLLEAGUES(j);
inc(i);
   
enddo;

    maxJ =
count(FAMILY);
   
do j=1 while j <= maxJ
        NAME(i) = FAMILY(j);
inc(i);
   
enddo;


On a side note, this section of the forum, feature requests, is if a user wants a new function or capability added to the software. Your request is just a regular question on how to do something in CSPro, and so should be submitted within the Entry section.

Sherrell

Re: labels of the occurrences

Posted: September 19th, 2021, 8:52 pm
by Maria kaab
Thank you Sherrell