BookmarkSubscribeRSS Feed
deleted_user
Not applicable
input data looks like this
id date counts
10 5/1 10
10 5/2 5
10 5/3 10

data runningtot;
set input end = finished;
totcount + count;
output;
if finished then do;
date = . ;
count = .;
output;
end;
run;
output will look like this:
ID DATE COUNT TOTCOUNT
10 5/1 10 10
10 5/2 5 15
10 5/3 10 25
10 25
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Actually, the data will look like this:
[pre]
Obs id date count totcount
1 10 05/01 10 10
2 10 05/02 5 15
3 10 05/03 10 25
4 10 . . 25
[/pre]
(Note missing values for OBS #4 for the Date var and the COUNT var) -- if you do a proc print on the runningtot table based on the following code:
[pre]
data input;
infile datalines;
input id date : mmddyy8. count;
return;
datalines;
10 5/1/07 10
10 5/2/07 5
10 5/3/07 10
;
run;

data runningtot;
set input end = finished;
totcount + count;
output;
if finished then do;
date = . ;
count = .;
output;
end;
run;

proc print data=runningtot;
format date mmddyy5.;
run;
[/pre]

Not sure what your question was.
cynthia

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 889 views
  • 0 likes
  • 2 in conversation