SAS Create new dataset with Month qualifier

Reply
Frequent Contributor
Posts: 78

SAS Create new dataset with Month qualifier

Anybody has sample code to allocate the New Dataset which going to hold the Performance database members for a particular month ...I want dataset to be allocated with Month qualifier ..and platform is zOS..

Super User
Super User
Posts: 7,401

Re: SAS Create new dataset with Month qualifier

You will need to provide more information.  To create datasets you can use data xyz;, or proc sql create table.  To get data from a database use proc sql with either connect to your database or via libname.  To add month then just add number to the data step definition.

Respected Advisor
Posts: 3,889

Re: SAS Create new dataset with Month qualifier

I assume that when you say "New Dataset" you actually want a new file which holds these tables.

It's quite a while that I've worked with z/OS but if I remember right then you have 2 options as also documented here: SAS(R) 9.2 Companion for z/OS

A)

- Create the file name with the date part dynamically and store it in a macro variable, eg: &mypath: ABC.XXX.01012014

- Submit a libname in the form: LIBNAME MYLIB "&MYPATH" DISP=NEW;

B)

I remember that we used to have a SAS macro which generated code "on the fly":

- Create some JCL which allocates the new library, last statement is to put all the generated code into the internal reader so that it gets executed (you'll find examples by Googling "JCL INTRD").

- Define a libname statement with DISP=OLD (as the macro already created the file).

Ask a Question
Discussion stats
  • 2 replies
  • 171 views
  • 0 likes
  • 3 in conversation