BookmarkSubscribeRSS Feed
lola
Calcite | Level 5

As I improve my programming but still leverage the existing program code from the prgms I received, I attached a new var(s) to similar code, but it is not tight enough, therefore I need to add another condition, which I think should be something along the lines of first.obs. Here is a bit of the code. Please direct me if you know of a keyword for a tutorial. Thank you.[as i learn and improve, I am shameless in sharing my inefficient code].

So I want the first obs to count using pers07 for those who received earned income in this unit.

do i=1 to 16;
if first.affil(i)=1 then do;
if 5<erned(i)<=3000 then do;/* EARNED INCOME */
pers07+wght;
end;
end;

end;

1 REPLY 1
lola
Calcite | Level 5

Ok, I got this! Yay! long hand code, then arrays...

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 342 views
  • 1 like
  • 1 in conversation