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.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 3 replies
  • 496 views
  • 0 likes
  • 2 in conversation