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
 

 

Current Date/Time thru JCL without writing any pgm.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
apandey

New User


Joined: 31 Aug 2009
Posts: 73
Location: Mumbai

PostPosted: Fri Sep 23, 2011 2:15 pm    Post subject: Current Date/Time thru JCL without writing any pgm.
Reply with quote

Hi All,
I have a requirement where I need to create a output file with only 2 records.
layout/date is as below:

SENDDATE=CURRENT_DATE
TIMESTAMP=CURRENT_TIME

Here SENDDATE and TIMESTAMP are constant fields. and CURRENT_DATE/TIME should be system's date and time.
For Ex:
SENDDATE=2011-09-23
TIMESTAMP=04.31.58

Is there is anyway to do this thru JCL(SORT) or some any other utility.
Pls help me on this.
Back to top
View user's profile Send private message

Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 785
Location: Chennai, India

PostPosted: Fri Sep 23, 2011 2:30 pm    Post subject:
Reply with quote

If you have DFSORT installed, please refer "Insert date and time of run into records" section of the below document.

ftp://ftp.software.ibm.com/storage/dfsort/mvs/sorttrck.pdf
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Sep 23, 2011 3:12 pm    Post subject: Reply to: Current Date/Time thru JCL without writing any pgm
Reply with quote

Below DFSORT step will give desired...
Code:

//S1    EXEC  PGM=SORT                 
//SYSOUT    DD  SYSOUT=*               
//SORTIN DD *                           
 DUMMY                                 
/*                                     
//SORTOUT DD  SYSOUT=*                 
//SYSIN    DD    *                     
  SORT FIELDS=COPY                     
  OUTFIL REMOVECC,NODETAIL,             
  HEADER1=(C'SENDDATE=',DATE=(4MD-),/,C'TIMESTAMP=',TIME=(24.))
/*                                     

Output will be like...
Code:

SENDDATE=2011-09-23 
TIMESTAMP=10.44.07   
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 Sep 23, 2011 4:01 pm    Post subject: Reply to: Current Date/Time thru JCL without writing any pgm
Reply with quote

You could also use EZACFSM1 to achieve the same results.
Back to top
View user's profile Send private message
apandey

New User


Joined: 31 Aug 2009
Posts: 73
Location: Mumbai

PostPosted: Wed Sep 28, 2011 2:32 pm    Post subject:
Reply with quote

Hi All,
I have a input file where I have 2 fields as MDL-PROCESS-DATE and
MDL-PROCESS-TIME, this 2 fields contains date in YYYYMMDD format and time in HHMM format.
now I want to overwrite this 2 fields value with Current Date and Time.
Date field starts from position 5th and Time field starts from position 13th.

I tried below SORT Card but its giving Syntax error. can any one pls help.

******************* TOP OF DATA*******************
SYNCSORT FOR Z/OS 1.3.2.2R U.S. PATENTS: 4210961, 5117495 (C) 2007 SYNCSO
Chrysler Group LLC z/OS 1.11.0
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 36515, MODEL 2097 711 LICEN
SYSIN :
SORT FIELDS=COPY
OUTREC FIELDS=((5:5,&DATENS=(4MD)),(13:13,&TIMENS=(24)))
*
WER268A OUTREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
******************** BOTTOM OF DATA *********************
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Wed Sep 28, 2011 2:59 pm    Post subject:
Reply with quote

Try taking out the brackets around your two fields, unless you got that from a manual? Not seen it before, no SyncSort manual to check.

EDIT: And put anything which you have gone to the bother of formatting into the Code tags, else you have just wasted your time and will waste ours as it looks like everything starts in the wrong column and the * points to the wrong place.
Back to top
View user's profile Send private message
apandey

New User


Joined: 31 Aug 2009
Posts: 73
Location: Mumbai

PostPosted: Wed Sep 28, 2011 3:11 pm    Post subject:
Reply with quote

Thanks Bill ..
Anyway another moderator of this forum sits near to me in my project(luckily). icon_razz.gif
He is 'Anuj Dhawan' , He solved my doubt. Thanks Anuj.
Here is the sort card:
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(5:&DATE1,13:&TIME2)
/*
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DD DUMMY & CPU TIME Nileshkul Testing & Performance analysis 16 Mon Dec 19, 2016 11:35 pm
This topic is locked: you cannot edit posts or make replies. Get a job submitted itself every time... arunsoods JCL & VSAM 3 Tue Nov 22, 2016 4:05 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am


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