labels of the occurrences

What would you like to see in CSPro?
Forum rules
New release: CSPro 8.0
Post Reply
Maria kaab
Posts: 2
Joined: September 17th, 2021, 12:43 pm

labels of the occurrences

Post 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 ?
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: labels of the occurrences

Post 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
Last edited by sherrell on September 19th, 2021, 9:39 pm, edited 1 time in total.
Maria kaab
Posts: 2
Joined: September 17th, 2021, 12:43 pm

Re: labels of the occurrences

Post by Maria kaab »

Thank you Sherrell
Post Reply