BookmarkSubscribeRSS Feed
sas_
Fluorite | Level 6
Hi

In a variable i am having 3 obs down,open,enter

Data l;
input name age;
down 45
open 67
enter 89
open 67
down 45
enter 90
open 56
run;

if down and continuing with open then down-open
like that if enter continuing with open the enter-open like that i want
1 REPLY 1
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Not sure about how the SUBJECT correlates to the post/message body.

In a DATA step, if you need to "retain" an observation's value across DATA step passes, look at using a RETAIN statement to capture (with a SAS assignment statement), a temporary SAS variable, as required by your program.

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search argument, this topic / post:

programming intro data step retain site:sas.com

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 935 views
  • 0 likes
  • 2 in conversation