View previous topic :: View next topic
|
Author |
Message |
himantgoyal Warnings : 1 New User
Joined: 14 Aug 2006 Posts: 8
|
|
|
|
Hi ,
Could anyone please help me , How I can retrieve system date in Sort JCl in MMDDYY format
My control card is
SORT FIELDS=COPY
OUTREC FIELDS(1,44,date)
1-44 is data from input file. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
Try this
Code: |
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(DATE=(MD4-))
/* |
|
|
Back to top |
|
|
himantgoyal Warnings : 1 New User
Joined: 14 Aug 2006 Posts: 8
|
|
|
|
Using above ,date is coming in 07-10-2008 format . I want in 071008 (MMDDYY) format |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
Ok, before I go ahead with some other suggestion, one more thing to know, why did you show
Quote: |
OUTREC FIELDS(1,44,date) |
in your example ? I didn't get it. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
himantgoyal,
DATENS=(MDY) in TRAILER1 will give you an 'mmddyy' date.
But if you want the 'mmddyy' date to replace date in your OUTREC statement, you can use a DFSORT job like this:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
TDATE,S'&DAY.&MON.&YR2'
/*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
SORT FIELDS=COPY
OUTREC BUILD=(1,44,TDATE)
/*
|
|
|
Back to top |
|
|
Vasukip Currently Banned New User
Joined: 17 Jun 2008 Posts: 48 Location: Chennai
|
|
|
|
Frank,
I tried this control Statement - SYMNAMES with String I'm getting user abend.
fyi,
Code: |
SYNCSORT FOR Z/OS 1.2.2.1R U.S. PATENTS:
* P
PRODUCT LICENSED FOR CPU SERIAL NUMBER AC56E,
*** ERRORS IN SYMNAMES STATEMENTS ***
TDATE,S'&DAY.&MON.&YR2'
*
*** SYNTAX ERROR ***
WER470A SYMNAMES ERRORS FOUND
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
|
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You system is running Syncsort rather than DFSORT. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
Vasukip wrote: |
I tried this control Statement - SYMNAMES with String I'm getting user abend. |
Support for SYMNAMES is available in 1.3 onwards releases of SyncSort, You are using little earlier version (from the SYSOUT you posted in earlier post)
Code: |
SYNCSORT FOR Z/OS 1.2.2.1R U.S. PATENTS: |
so the error was there.
Again, do you want the 'mmddyy' date to replace date in your OUTREC statement ? or would this suffice
Code: |
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(DATENS=(MDY))
/* |
|
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
Here are 2 possible solutions:
Code: |
//STEP1 EXEC PGM=SORT
//SORTIN DD DSN=input.file
//SORTOUT DD DSN=output.file
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(INIT),
BUILD=(1,44,&DATE)),
IFTHEN=(WHEN=(47,1,CH,EQ,C'/'),
BUILD=(1,44,45,2,48,2,51,2))
/* |
Code: |
//STEP1 EXEC PGM=SORT
//SORTIN DD DSN=input.file
//SORTOUT DD DSN=output.file
//SYSOUT DD SYSOUT=*
//SYSIN DD *
INREC FIELDS=(1,44,&DATE)
SORT FIELDS=COPY
OUTREC FIELDS=(1,44,45,2,48,2,51,2)
/* |
|
|
Back to top |
|
|
|