Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Add current date and time to the file name

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
pjnithin

Active User


Joined: 22 Dec 2005
Posts: 116

PostPosted: Thu Jan 05, 2006 1:17 am    Post subject: Add current date and time to the file name
Reply with quote

I want to add current date and time as last qualifiers in a file.
How can i do it????
I need the file like
testfile.d20060104.t144650
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Jan 05, 2006 1:25 am    Post subject: Re: adding date and time to the file name
Reply with quote

Here's a few previous posts to get you started:

http://ibmmainframes.com/viewtopic.php?t=7825
http://ibmmainframes.com/viewtopic.php?t=6737
http://ibmmainframes.com/viewtopic.php?t=6503
http://ibmmainframes.com/viewtopic.php?t=4990
http://ibmmainframes.com/viewtopic.php?t=1124
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 239
Location: Cincinnati OH USA

PostPosted: Thu Jan 05, 2006 1:30 am    Post subject:
Reply with quote

note - dataset name nodes limited to 8 characters

Dave
Back to top
View user's profile Send private message
pjnithin

Active User


Joined: 22 Dec 2005
Posts: 116

PostPosted: Thu Jan 05, 2006 1:48 am    Post subject: Re: adding date and time to the file name
Reply with quote

Thanks SUPERK. It worked.
But why have to execute as 2 jobs in the same jcl???
what does this EZACFSM1 do???
When i remove the second job card and try to run this only STEP0100 is running. Can you please explain.


superk wrote:
Here's a few previous posts to get you started:

http://ibmmainframes.com/viewtopic.php?t=7825
http://ibmmainframes.com/viewtopic.php?t=6737
http://ibmmainframes.com/viewtopic.php?t=6503
http://ibmmainframes.com/viewtopic.php?t=4990
http://ibmmainframes.com/viewtopic.php?t=1124
http://ibmmainframes.com/viewtopic.php?t=1097
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Jan 05, 2006 1:53 am    Post subject: Re: adding date and time to the file name
Reply with quote

EZACFSM1 is the "symbol translator utility" as described here:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/F1A1B331/1.1.9.1?DT=20040427102404

This document describes the standard MVS system symbols:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA1E241/2.2.2
Back to top
View user's profile Send private message
pjnithin

Active User


Joined: 22 Dec 2005
Posts: 116

PostPosted: Thu Jan 05, 2006 2:47 am    Post subject: Re: adding date and time to the file name
Reply with quote

Ok, that explained lot many things to me.
Again, is there a way to do all this in a single job rather than calling a second job.

superk wrote:
EZACFSM1 is the "symbol translator utility" as described here:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/F1A1B331/1.1.9.1?DT=20040427102404

This document describes the standard MVS system symbols:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA1E241/2.2.2
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 239
Location: Cincinnati OH USA

PostPosted: Thu Jan 05, 2006 2:56 am    Post subject:
Reply with quote

some job scheduling products do this


Dave
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Jan 05, 2006 3:08 am    Post subject: Re: adding date and time to the file name
Reply with quote

Here's one of many possibilities:
Code:

//STEP0001 EXEC PGM=...
//...
//SYSUT2   DD DSN=TESTFILE,DISP=(,CATLG),UNIT=SYSDA,
//         SPACE=(CYl,(1,1),RLSE
//*                                                               
//STEP0002 EXEC PGM=EZACFSM1                                     
//SYSOUT   DD   DSN=&&CNTL,DISP=(,PASS),                         
//         UNIT=SYSDA,SPACE=(CYL,(1,1),RLSE)                     
//SYSIN    DD   *                                                 
  ALTER 'TESTFILE' -                                     
    NEWNAME('TESTFILE.D&YR2&MON&DAY..T&HR&MIN&SEC')     
/*                                                               
//*                                                               
//STEP0003 EXEC PGM=IDCAMS                                       
//SYSPRINT DD   SYSOUT=*                                         
//SYSIN    DD   DSN=&&CNTL,DISP=(OLD,DELETE)                     
//*                                                               


If you would go through all of those links, you'll find a lot of other alternatives, as well as considering Dave's suggestion.
Back to top
View user's profile Send private message
pjnithin

Active User


Joined: 22 Dec 2005
Posts: 116

PostPosted: Fri Jan 06, 2006 9:59 am    Post subject: why 2 different jobs
Reply with quote

Code:

//jobname  JOB (),' STEP 1 ',                   
//STEP01   EXEC PGM=EZACFSM1                                       
//SYSOUT   DD SYSOUT=(*,INTRDR)                                   
//SYSIN    DD DATA                                                 
//jobname  JOB (),' STEP 2 ',                   
//STEPK1   EXEC PGM=IEBGENER                                       
//SYSPRINT DD SYSOUT=*                                             
//SYSOUT   DD *                                                   
//SYSUT1   DD  DSN=input,         
//             DISP=SHR                                           
//SYSUT2   DD  DSN=input.D&MON.&DAY,                       
//             DISP=(,CATLG,DELETE),                               
//             SPACE=(CYL,(1,2),RLSE),                             
//             UNIT=SYSDA,                                         
//             DSORG=PS,                                           
//             LRECL=900,                                         
//             RECFM=FB                                           
//SYSIN   DD  DUMMY                                               
/*                                   

This job is running fine and giving me the desired output.
But why I have to use another job within the same job?????
What is the erason behind this????

Is there any way by which I can run the second part as just another step in the same jcl itself rather than doing it as a different job.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Fri Jan 06, 2006 6:21 pm    Post subject: Re: why 2 different jobs
Reply with quote

pjnithin wrote:

Is there any way by which I can run the second part as just another step in the same jcl itself rather than doing it as a different job.


Yes, as was shown in the posts:

Code:

//jobname  JOB (),' STEP 2 ',...
// SET MON=01
// SET DAY=06
//STEPK1   EXEC PGM=IEBGENER                                       
//SYSPRINT DD SYSOUT=*                                             
//SYSOUT   DD *                                                   
//SYSUT1   DD  DSN=input,         
//             DISP=SHR                                           
//SYSUT2   DD  DSN=input.D&MON.&DAY,                       
//             DISP=(,CATLG,DELETE),                               
//             SPACE=(CYL,(1,2),RLSE),                             
//             UNIT=SYSDA,                                         
//             DSORG=PS,                                           
//             LRECL=900,                                         
//             RECFM=FB                                           
//SYSIN   DD  DUMMY


Or, again, as Dave had suggested, use the system variables provided by your job scheduling system.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
No new posts CICS transaction slow response time vasanthz All Other Mainframe Topics 1 Thu Jan 19, 2017 1:31 am
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts DD DUMMY & CPU TIME Nileshkul Testing & Performance analysis 16 Mon Dec 19, 2016 11:35 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us