DATA Step, Macro, Functions and more

(GENNUM= ) Data Set Option

Reply
Contributor
Posts: 61

(GENNUM= ) Data Set Option

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;
Super Contributor
Super Contributor
Posts: 365

Re: (GENNUM= ) Data Set Option

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
Ask a Question
Discussion stats
  • 1 reply
  • 162 views
  • 0 likes
  • 2 in conversation