Help using Base SAS procedures

Copying value until end of file

Reply
N/A
Posts: 0

Copying value until end of file

Hello

I have a SAS datasets generated monthly to which I would like to include a new variable called FileDate. The filedate variable has a fixed value of end of month

Could anybody help me as to how I can :
- Copy this value of filedate till the end of file is reached or the last record of each monthly dataset.
- Roll up these datasets to a quarterly jumbo dataset.

Thanks for your time.
Super Contributor
Posts: 359

Re: Copying value until end of file

data xxx;
set monthly1;
RETAIN FILEDATE value;
...
...
...
Run;

proc append;
base=jumbo;
data = xxx;
run;
etc
Super Contributor
Super Contributor
Posts: 3,174

Re: Copying value until end of file

To address your quarterly jumbo file request, you should have a "month ending" date, and with that you can derive a quarter-ending/starting date using the INTNX function in a DATA step assignment statement. Then depending on your SAS variables, you can use PROC SUMMARY / MEANS to generate your quarterly file using the quarter-ending date in your CLASS / BY statement.

Scott Barry
SBBWorks, Inc.
Ask a Question
Discussion stats
  • 2 replies
  • 88 views
  • 0 likes
  • 3 in conversation