Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ftp naming conventions

Status
Not open for further replies.

cferrara

Programmer
Feb 10, 2003
1
AU
Running FTP on Mainframe Z/OS. I want to insert a date when renaming an ftp file (i.e. file.10-27-2003) using JCL control card. Does anyone know how to insert the date at the end of the file name?
 
In my shop the FTP is performed in a PROC and after it is executed we do a rename:

//RENAM1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
ALTER -
YourFile-
NEWNAME (Yourfile.R040223)
 
Use the SET statement to set a variable to the date required, then rename the file:

//JOB (ABC)...,CLASS=T,MSGCLASS=T
//*
// SET THEDATE=022704
//*
//DELETE EXEC PGM=IEFBR14
//FILE1 DD DSN=MYHLQ.NODE2.NODE3.D&THEDATE,
// DISP=(MOD,DELETE,DELETE)
//*
//RENAME EXEC PGM=IEBGENER
//SYSUT1 DD DSN=MYHLQ.NODE2.NODE3,
// DISP=(OLD,DELETE,KEEP)
//SYSUT2 DD DSN=MYHLQ.NODE2.NODE3.D&THEDATE,
// DISP=(,CATLG,DELETE)
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY

A SET command can be included within the JCL, or can be pulled from an external library with an INCLUDE command.

Of course, you can write a program, or use any number of utilities, to code a rename process.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top