Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Syncsort - DATEDIFF syntax error

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort - DATEDIFF syntax error
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7306

PostPosted: Thu May 10, 2012 11:44 pm    Post subject: Reply to: Difference between two dates
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

Site Director


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

PostPosted: Thu May 10, 2012 11:49 pm    Post subject:
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    Post subject: Reply to: Difference between two dates
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

Site Director


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

PostPosted: Fri May 11, 2012 1:09 am    Post subject:
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    Post subject: Reply to: Difference between two dates
Reply with quote

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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7306

PostPosted: Fri May 11, 2012 1:22 am    Post subject: Reply to: Difference between two dates
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

Site Director


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

PostPosted: Fri May 11, 2012 1:22 am    Post subject: Reply to: Difference between two dates
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

Site Director


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

PostPosted: Fri May 11, 2012 1:33 am    Post subject:
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    Post subject: Reply to: Syncsort - DATEDIFF syntax error
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

Site Director


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

PostPosted: Tue May 15, 2012 7:00 pm    Post subject: Reply to: Syncsort - DATEDIFF syntax error
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need help with below DB2 error ashek15 DB2 3 Sat Mar 18, 2017 5:56 am
No new posts FINDREP Syntax Error seahawk789 DFSORT/ICETOOL 4 Thu Mar 09, 2017 10:11 pm
No new posts INVOKE WEBSERVICE error danik56 CICS 11 Thu Mar 09, 2017 11:52 am
No new posts Row not found Sql error GaganGarg DB2 7 Tue Mar 07, 2017 6:29 am
No new posts DB2 SQL Error: SQLCODE=-440, SQLSTATE... kishpra DB2 1 Sat Feb 18, 2017 2:31 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us