05-17-2017 03:28 PM
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.
05-17-2017 04:55 PM
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),
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?
05-17-2017 06:32 PM - edited 05-17-2017 06:35 PM
From What's New in SAS(R) 9.4