View previous topic :: View next topic
|
Author |
Message |
Raja Durai
New User
Joined: 06 Jul 2008 Posts: 6 Location: chennai
|
|
|
|
Hi,
I am just trying in SYNCSORT to find the difference between the dates but it is not working. Can you please help me with the below code?
Code: |
//STEP01 EXEC PGM=SORT
//SORTIN DD *
20010101 20010101
20010101 20010102
20010101 20010103
20010101 20010104
/*
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
INREC FIELDS=(1,8,Y4T,DATEDIFF,10,8,Y4T)
SORT FIELDS=COPY
/* |
and my sysout looks like :
Code: |
SYSIN :
INREC FIELDS=(1,8,Y4T,DATEDIFF,10,8,Y4T)
*
SORT FIELDS=COPY
WER268A INREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE |
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Did you read the thread? What level of Syncsort are you on? What does your documentation say about DATEDIFF? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Looks like you dd not post what may be the most important bit of the sysout for this question. . .
At the top of the sysout is the release of Syncsort that is being used.
If it is not at least 1.4, i don't believe DATEDIFF is available. . .
Also, i believe the syntax is not complete/correct. |
|
Back to top |
|
|
Raja Durai
New User
Joined: 06 Jul 2008 Posts: 6 Location: chennai
|
|
|
|
Hi,
Our shop using SYNCSORT FOR Z/OS 1.4.0.1R. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Then you need to look in the manual and correct the syntax.
If i remember, you need to specify the date fields and a place to store the difference. . . |
|
Back to top |
|
|
Raja Durai
New User
Joined: 06 Jul 2008 Posts: 6 Location: chennai
|
|
|
|
Thank you D.Sch .. I will try |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
And please don't tailgate an old topic, but start a new one with your own question next time. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
You're welcome - good luck
If you post your solution, it will most likely help someone else one day. So far yours is the first Syncsort topic to mention datediff. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Follow up:
You might want to look at DT and/or DTNS in the manual (or anything else that might be needed by DATEDIFF.
Not able to test just now, but did manage a quick look in the manual.
Your question has been split to a new topic. |
|
Back to top |
|
|
Raja Durai
New User
Joined: 06 Jul 2008 Posts: 6 Location: chennai
|
|
|
|
Hi
The Below JCL would work with DATEDIFF for SYNCSORT 1.4 .
Code: |
//SORT1 EXEC PGM=SORT,PARM='CENTWIN=80'
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SORTIN DD *
20010101 20010101
20010101 20010102
20010101 20010103
20010101 20010104
//SYSIN DD *
INREC FIELDS=(1,18,
DATEDIFF=(10,8,DTNS=(4MD),1,8,DTNS=(4MD),DAY),M12,LENGTH=3)
SORT FIELDS=COPY
/* |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Thanks, Raja
d |
|
Back to top |
|
|
|