BookmarkSubscribeRSS Feed
SASUSER21
Fluorite | Level 6

 

Can we create new GDGs on Mainframe by exporting files?

4 REPLIES 4
Marty_Rhodes
Calcite | Level 5

You certainly can with SAS in batch.  With interactive SAS it depends on whether your site allows tape mounts for interactive users.  With modern VTS systems there probably isn't a good reason not to allow that but many mainframe sites restrict interactive tape mounts to IT support personnel.  Back in the day when tape mounts involved physically mounting actual tapes, such restrictions were probably warranted for sites with lots of "less than IT-savy" users.

 

Marty Rhodes 

SASUSER21
Fluorite | Level 6

Can you please share a sample code for the same.

Thanks.

Marty_Rhodes
Calcite | Level 5

Since you said a new GDG, then I am assuming the GDG has not been defined yet.  You can do this with a small batch job that does a step like this:

 

//GDGDEF   EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
  DEFINE GDG (NAME(MYGDG.DATA) -
  LIMIT(20) NOEMPTY SCRATCH)
/*

 

Once your GDG has been defined to Z/OS, you can then use it with SAS.  I will assume you are running SAS in batch but there are equivalent ways to do it with interactive SAS.  Just add a DD to your SAS step that looks like this:

 

//GDGOUT   DD UNIT=DISK,SPACE=(TRK,(howevermanytracks,howevermanymoretracks),RLSE),
//         DISP=(,CATLG,DELETE),DSN=MYGDG.DATA(+1)

 

The "+1" adds a new generation to the GDG as generation 0.  You may need to specify  the DCB for your GDGOUT file depending on how you plan to write to it in SAS.

 

Now just refer to the fileref GDGOUT in you SAS code that outputs whatever you want to write to the GDG.  For example to write to it in a DATA step you could use the SAS statement:

 

file gdgout old;

put "This will be writen to the GDG file 'MYGDG.DATA(0)' on Z/OS";

 

 

All of this assumes you have permission to do these things at your mainframe site.  Does that help?

 

 

 

 

Patrick
Opal | Level 21

 

From What's New in SAS(R) 9.4

http://support.sas.com/documentation/cdl/en/whatsnew/64788/HTML/default/viewer.htm#n14c8glgh3j7hxn1b...

 

The fourth maintenance release for SAS 9.4 has these new features:
  • The .spds9 file extension is supported.
  • FILE/INFILE statement processing supports the BUFNO= SAS system option.
  • SAS added support for the IBM z/OS V2R2 Extended Format Generation Data Group (GDG), which allows up to 999 generation data sets to be associated with the GDG.
For more information, see SAS Companion for z/OS 
 
And here the details in the SAS® 9.4 Companion for z/OS, Sixth Edition
 
 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 4 replies
  • 1476 views
  • 0 likes
  • 3 in conversation