IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Add current date and time to the file name


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Thu Jan 05, 2006 1:25 am
Reply with quote

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

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

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Thu Jan 05, 2006 1:30 am
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
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:

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

Global Moderator


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

PostPosted: Thu Jan 05, 2006 1:53 am
Reply with quote

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

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

This document describes the standard MVS system symbols:

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
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:

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

This document describes the standard MVS system symbols:

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: 419
Location: Inside the SPEW (Southwest Ohio, USA)

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

some job scheduling products do this


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

Global Moderator


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

PostPosted: Thu Jan 05, 2006 3:08 am
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
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

Global Moderator


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

PostPosted: Fri Jan 06, 2006 6:21 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top