View previous topic :: View next topic
|
Author |
Message |
apandey
New User
Joined: 31 Aug 2009 Posts: 73 Location: Mumbai
|
|
|
|
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 or SORT or some any other utility.
Pls help me on this. |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
You could also use EZACFSM1 to achieve the same results. |
|
Back to top |
|
|
apandey
New User
Joined: 31 Aug 2009 Posts: 73 Location: Mumbai
|
|
|
|
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.
Code: |
******************* 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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
apandey
New User
Joined: 31 Aug 2009 Posts: 73 Location: Mumbai
|
|
|
|
Thanks Bill ..
Anyway another moderator of this forum sits near to me in my project(luckily).
Here is the sort card:
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(5:&DATE1,13:&TIME2)
/* |
|
|
Back to top |
|
|
nandeshwar
New User
Joined: 11 Oct 2010 Posts: 45 Location: Delhi
|
|
|
|
&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 |
|
|
nupurbhui
New User
Joined: 25 May 2023 Posts: 18 Location: India
|
|
|
|
Hi,
I need the date format to be YYYYMMDDHHMMSS format using HEADER1 fucntion, from the 34th column.
Ive tried using the below but not able to get this exact format:
34:DATENS=(YMD) ------------------> 230525
:DATE=(4MD-) --------------------> 2023-05-25
34:DATENS=(YMD),TIME=(24 ) ---> 23052507 55 42
Code:
//STEP01 EXEC PGM=SORT
//SORTIN DD DSN=FILE1,DISP=SHR
//SORTOUT DD DSN=FILE2,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,
HEADER1=(1:C'$F BDAINTRA',25:C'XXXXXXX',34:&DATE4),
TRAILER1=(1:C'$E BDAINTRA',25:C'XXXXXXX')
/* |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2147 Location: USA
|
|
|
|
apandey wrote: |
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. |
Code: |
// EXPORT SYMLIST=*
// . . . . . . . . . . . . .
//GENERATE EXEC PGM=IEBGENER
//SYSPRINT DD DUMMY
//SYSIN DD DUMMY
//SYSUT1 DD *,SYMBOLS=EXECSYS
SENDDATE=&LYR4-&LMON-&LDAY
TIMESTAMP=&LHR..&LMIN..&LSEC.
//*
//SYSUT2 DD . . . . output dataset
// |
P.S.
All "&L..." above stand for "local time".
Without letter 'L' you can use UTC time and date. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1341 Location: Bamberg, Germany
|
|
|
|
Export of the SYMLIST is not necessary for this case.
To consider is, that the Jobclass must allow the use of symbols. For ex:
Code: |
$HASP837 JOBCLASS(A) SYSSYM=ALLOW |
|
|
Back to top |
|
|
nupurbhui
New User
Joined: 25 May 2023 Posts: 18 Location: India
|
|
|
|
Hi,
I need the date format to be YYYYMMDDHHMMSS format using HEADER1 fucntion, from the 34th column.
Ive tried using the below but not able to get this exact format:
34:DATENS=(YMD) ------------------> 230525
:DATE=(4MD-) --------------------> 2023-05-25
34:DATENS=(YMD),TIME=(24 ) ---> 23052507 55 42
Code:
//STEP01 EXEC PGM=SORT
//SORTIN DD DSN=FILE1,DISP=SHR
//SORTOUT DD DSN=FILE2,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,
HEADER1=(1:C'$F BDAINTRA',25:C'XXXXXXX',34:&DATE4),
TRAILER1=(1:C'$E BDAINTRA',25:C'XXXXXXX')
/* |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2147 Location: USA
|
|
|
|
0. Do not tailgate previous topics for your own new questions.
1. Learn how to use the Code button when posting your samples. Otherwise >75% of users ignore your appeals.
2. Present exactly what you really get after your attempts, and how you’d like to see your results. |
|
Back to top |
|
|
nupurbhui
New User
Joined: 25 May 2023 Posts: 18 Location: India
|
|
|
|
Hi,
Sorry, I'm new to this forum. Could you please help me understand how to add code snippet images in the messages.
I will start the issue as a new topic.
Thanks for the reply! |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 736 Location: Denmark
|
|
|
|
"how to add code snippet"
Paste the code, mark the text, hit the 'Code' botton. |
|
Back to top |
|
|
nupurbhui
New User
Joined: 25 May 2023 Posts: 18 Location: India
|
|
|
|
Willy Jensen wrote: |
"how to add code snippet"
Paste the code, mark the text, hit the 'Code' botton. |
Got it. Thanks a lot ! |
|
Back to top |
|
|
nupurbhui
New User
Joined: 25 May 2023 Posts: 18 Location: India
|
|
|
|
I have started it as a new topic also. Thanks! |
|
Back to top |
|
|
|