BookmarkSubscribeRSS Feed
Jay_TxOAG
Quartz | Level 8

I am creating a CPORT file and I have this SAS code to create the FILENAME

 

FILENAME DWNLFILE 'CPORT.MYFILE' DISP=(NEW,CATLG,DELETE) UNIT=TAPEE VOLCOUNT=99 LRECL=80 BLKSIZE=8000 DSORG=PS RECFM=FB;

 

My current method of UNCATALOGing this file is to do it in JCL. However I would like to set one macro var for the filename literal that would be used in UNCATALOGing the file, creating the filename, and downloading the file via FTP.

 

I claim no expertise in z/OS operating systems. Any help is appreciated.

3 REPLIES 3
Shmuel
Garnet | Level 18

I'm not sure I understand correctly what you mean by "uncatoging".

 

1) can you post your JCL used? that may help.

 

2) does next code do what you need:

    

FILENAME DWNLFILE;

 

Jay_TxOAG
Quartz | Level 8

I use this in my JCL to uncatalog/clear/delete the file.

000003 //DEL     EXEC PROC=UCC11RMS,TYPRUN='P'
000024 //DWNL DD DSN=CSUSER.CPORT.DWNL,DISP=(NEW,CATLG,KEEP), 000025 // UNIT=TAPEE,VOL=(,,,99), 000026 // DCB=(LRECL=80,RECFM=FB,BLKSIZE=8000)

Then to create my FILENAME, which I need for my CPORT statement, I do the following

000057 FILENAME DWNLFILE "CSUSER.CPORT.DWNL"         
000058  DISP=(NEW,CATLG,DELETE) UNIT=TAPEE VOLCOUNT=99
000059  LRECL=80 BLKSIZE=8000 DSORG=PS RECFM=FB;      

 

I (just) realize that one solution would be to have a delete step after the CPORT is complete. Then weekly runs of the job would allow the FILENAME statement would work. 

However, I would like to know if there is a way either in the FILENAME statement or in a separate SAS statement to "reuse"  CSUSER.CPORT.DWNL.

 

If this were possible, then I could just create a macro var for the "DWNL" portion of the filename and use it where needed. I will need to duplicate this type of job to download many data sets.

Thanks for your time.

Shmuel
Garnet | Level 18

If you want to delete the catalog file you can do it by sas:

 

filename mycat .........;

try one of next two statements:

1) rc = fdelete(mycat);

2) rc = filedelete("<full path and file name>");

better check for full documentation and syntax, maybe you need some more options 

to add to filedelete() function.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 974 views
  • 0 likes
  • 2 in conversation