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

Current Date/Time thru JCL without writing any pgm


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 792
Location: Chennai, India

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

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

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

Global Moderator


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

PostPosted: Fri Sep 23, 2011 4:01 pm
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7311
Location: Inside the Matrix

PostPosted: Wed Sep 28, 2011 2:59 pm
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
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
nandeshwar

New User


Joined: 11 Oct 2010
Posts: 45
Location: Delhi

PostPosted: Thu May 11, 2017 4:12 pm
Reply with quote

apandey wrote:
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)
/*


@Anuj Dhawan... I really want to thank you for the sort you gave me in just two lines.. icon_smile.gif
&DATE function is really helpful with &DATE1, &DATE2, &DATE3, &DATE4 and &DATE5 .. it solved my problem which I was working on for past 3-4 days
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Date conversion using SORT SYNCSORT 4
No new posts Modify Several JCLs at the Same Time JCL & VSAM 6
No new posts Date Conversion Y2T to Y2W SYNCSORT 8
No new posts Date format conversion DFSORT/ICETOOL 4
No new posts Hex Value - vb file replace old date ... DFSORT/ICETOOL 14
Search our Forums:

Back to Top