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

Syncsort - DATEDIFF syntax error


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Raja Durai

New User


Joined: 06 Jul 2008
Posts: 6
Location: chennai

PostPosted: Thu May 10, 2012 11:14 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Thu May 10, 2012 11:44 pm
Reply with quote

Did you read the thread? What level of Syncsort are you on? What does your documentation say about DATEDIFF?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu May 10, 2012 11:49 pm
Reply with quote

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
View user's profile Send private message
Raja Durai

New User


Joined: 06 Jul 2008
Posts: 6
Location: chennai

PostPosted: Fri May 11, 2012 12:43 am
Reply with quote

Hi,

Our shop using SYNCSORT FOR Z/OS 1.4.0.1R.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri May 11, 2012 1:09 am
Reply with quote

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
View user's profile Send private message
Raja Durai

New User


Joined: 06 Jul 2008
Posts: 6
Location: chennai

PostPosted: Fri May 11, 2012 1:13 am
Reply with quote

Thank you D.Sch .. I will try
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Fri May 11, 2012 1:22 am
Reply with quote

And please don't tailgate an old topic, but start a new one with your own question next time.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri May 11, 2012 1:22 am
Reply with quote

You're welcome - good luck icon_smile.gif

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri May 11, 2012 1:33 am
Reply with quote

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
View user's profile Send private message
Raja Durai

New User


Joined: 06 Jul 2008
Posts: 6
Location: chennai

PostPosted: Tue May 15, 2012 1:06 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 15, 2012 7:00 pm
Reply with quote

Thanks, Raja icon_smile.gif

d
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 PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
Search our Forums:

Back to Top