select a row in a group occurence

Discussions about CSEntry
Post Reply
Ayman

select a row in a group occurence

Post by Ayman »

I have a problem in cspro .. i just want to enter for each row in a group occurence identified by an ID, a set of field corresponding to this ID in another form.
Shall i program this with logic code or it must be done otherwise ??
i will be thinkful if you have a solution for this problem.
Gregory Martin
Posts: 1792
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: select a row in a group occurence

Post by Gregory Martin »

If I understand your question correctly, you are asking how to refer to fields on one form using an ID that exists on another form. For example, you might have one roster:

LINE_NUMBER, SEX, AGE

And on another form, another roster:

LINE_NUMBER2, EDUCATION, INCOME

If, on the second roster, you want to refer to fields on the first roster, you can do that with logic. The way I like to do this is to get a pointer to the line number in the first roster that is applicable to the person in the second roster. You can do that with the command seek. Here might be how you would code an education consistency check:
PROC EDUCATION

    
numeric lineNumFirstRoster = seek(LINE_NUMBER = LINE_NUMBER2);
    
    
if EDUCATION = 10 and AGE(lineNumFirstRoster) < 18 then
        
errmsg("Only people 18-years and above can have a master's degree!");
        
reenter;
    
endif;
Does this address your question?
Post Reply