BookmarkSubscribeRSS Feed
chandler
Fluorite | Level 6
I am running SAS v9.1.3 SP4 on Windows XP operating system. In our data mart there are Generational Datasets for each monthend file, ie.
MONTHEND,
MONTHEND#1
MONTHEND#2
MONTHEND#3

All the SAS documentation I could fined only talks about creating and maintaining generational datasets, and how to do a PROC PRINT on a specific generation number, but no instructions on how to reference and retrieve data from a specific generation number, in a data step.
I want to read data from MONTHEND#2, to create a subset of data, based on a where statement. Is this data step, below, the proper way to do that and is the syntax correct ?

DATA newfile;
set MONTHEND (GENNUM=2) ;
where account_numbers gt "1234" ;
run;
1 REPLY 1
SPR
Quartz | Level 8 SPR
Quartz | Level 8
Hello Chandler,

I do not see any problems with this syntax. The only thing I should mention that if account numbers contain both letters and digits then using GT operator could depend on sorting seqiences and have to be used with caution.

Sincerely,
SPR

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
  • 742 views
  • 0 likes
  • 2 in conversation