Hi
Using SAS 7.1.
I don't understand how the below loop works.
Does the "Leave" indicate the loop will be exited once a missing TYP is found?
For Eg if I=14 --> TYP(14)=missing, then IK=15.
It won't continue to see if TYP(13), TYP(12), ...TYP(1), has missing values. Thank you
It should be noted that the LEAVE statement is not valid within a non-looping/non-iterative DO-END block (an error message would occur!), unless this block is in turn located in a SELECT-END block or in a DO loop (as in your example).
In the latter situation, both the remaining iterations of the DO loop and the statements following the LEAVE statement in the DO-END block (if any) are skipped.
In your example (with missing TYP{14} and provided that TYP{15} is not missing) IK is set to 15 and no further IF-checks are performed.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.