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 Adding date in Sort step

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sreerocks

New User


Joined: 18 Jun 2008
Posts: 9
Location: chennai

PostPosted: Thu Dec 04, 2008 11:42 am    Post subject: SYNCSORT Adding date in Sort step
Reply with quote

Hi,

I wanted to add one offset value to a date parameter in a sort step.
Is it possible to use something like (&DATE,ADD,1...) in OUTREC ?

Could someone help me out with the correct syntax

Thanks
sree
Back to top
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Thu Dec 04, 2008 1:02 pm    Post subject:
Reply with quote

sreerocks,

What offset you want to add? Please post some examples of input and output records.
Back to top
View user's profile Send private message
sreerocks

New User


Joined: 18 Jun 2008
Posts: 9
Location: chennai

PostPosted: Thu Dec 04, 2008 1:27 pm    Post subject:
Reply with quote

for example: I want to add 1 day to 2008-12-05

Thanks
sree
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Thu Dec 04, 2008 5:16 pm    Post subject:
Reply with quote

sreerocks,

Offset to current date can be obtained using the below format. I cant test this feature now as it is available only in Syncsort for z/OS Release 1.3 or above.

&DATE [{±}nnnn] where '+' indicates a date after the current date and '–' indicates a date before the current date. 'nnnn' is the date offset. The range is 0 to 9999, which represents the number of days to be added or subtracted from the current date.
Back to top
View user's profile Send private message
sreerocks

New User


Joined: 18 Jun 2008
Posts: 9
Location: chennai

PostPosted: Thu Dec 04, 2008 6:47 pm    Post subject:
Reply with quote

Thanks arun..

I was wondering whether we can add some offset to a date other than
current date.

Thanks
sree
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Thu Dec 04, 2008 6:58 pm    Post subject:
Reply with quote

sreerocks,

I believe there are no built-in functions in Syncsort or DFSORT to do such arithmetic on a date field. Alissa/Frank might be able to explain further.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Thu Dec 04, 2008 10:05 pm    Post subject:
Reply with quote

(post removed)
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Dec 05, 2008 3:22 am    Post subject:
Reply with quote

Hi,

for DFSORT check this out

http://ibmmainframes.com/viewtopic.php?t=35250&highlight=y2w+gt+y


Gerry
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Fri Dec 05, 2008 7:20 am    Post subject:
Reply with quote

Gerry,

Thanks for the link. But the topic discusses about date comparison with an offset of current-date. Here, we talk about how to generate an offset of an input date field .
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Dec 05, 2008 8:19 am    Post subject:
Reply with quote

Hi Arun,

thanks for spotting my failure to read the thread correctly icon_redface.gif


Gerry
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Fri Dec 05, 2008 9:28 am    Post subject:
Reply with quote

Alissa,

I tried executing the Syncsort job suggested by you; but ended up in the below syntax error. Is this a feature included in Syncsort for z/OS Release 1.3?

Code:
 SYNCSORT FOR Z/OS  1.2.1.0R    U.S. PATENTS: xxxxxxx, xxxxxxx
                                           *** xxx, xxxx *** 
 PRODUCT LICENSED FOR CPU SERIAL NUMBER xxxxx, MODEL xxxx xxx
 SYSIN :                                                     
   SORT FIELDS=COPY                                           
   OUTREC FIELDS=(1,6,Y2T,ADD,+1)                             
                          *                                   
 WER268A  OUTREC 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
srinivas_cog

New User


Joined: 05 Jun 2008
Posts: 17
Location: chennai

PostPosted: Fri Dec 05, 2008 12:17 pm    Post subject:
Reply with quote

Arun,

It is working fine for SYNCSORT FOR Z/OS 1.3
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Fri Dec 05, 2008 12:40 pm    Post subject:
Reply with quote

Kasu,

Thanks for letting me know. icon_smile.gif
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Fri Dec 05, 2008 8:51 pm    Post subject:
Reply with quote

Quote:
I cannot answer for DFSORT, but this CAN be done in SyncSort. Here is an example:
I am looking forward to see Frank's comments on how this can be done in DFSORT. icon_rolleyes.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Dec 05, 2008 11:25 pm    Post subject:
Reply with quote

Quote:
I am looking forward to see Frank's comments on how this can be done in DFSORT


Why do you care given that you use Syncsort?

DFSORT doesn't have any built-in functions for date arithmetic on fields.

But since you brought it up, I have to wonder about Alissa's implication that you can use Y2x fields with ADD, DIV, MUL, etc in Syncsort. It doesn't seem very well defined. For 1,6,Y2T,ADD,+1, does +1 represent adding 1 day to get the correct date (e.g. 081130 + 1 = 081201)? How does that work for p,4,Y2T where Y2T represents only a 2-digit year and month (e.g. 0812 + 1 =?). And what would this mean:

1,6,Y2T,DIV,+5 (081130 / 5 = ?)

or this:

1,6,Y2T,MUL,+10 (081130 * 10 = ?)
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Sat Dec 06, 2008 12:25 am    Post subject:
Reply with quote

Based on Frank's statements, I ran some additional tests. My previous example will not work properly for all dates. (I will remove the incorrect code).

Arun's original statement is correct. Sreerocks, I would recommend finding an alternative solution for this requirement since SORT does not have an easy solution for your requirement at this time.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Sun Dec 07, 2008 5:35 pm    Post subject:
Reply with quote

Frank Yaeger wrote:
Quote:
I am looking forward to see Frank's comments on how this can be done in DFSORT
Why do you care given that you use Syncsort?
I personally believe "Information" is something that has to be shared. May be this is not of any use for me now, but may be some time later, or for somebody who uses DFSORT. Also it is as important to know which all functions are NOT feasible/difficult to do using a particular product as to know the functions which are present.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Dec 08, 2008 6:18 am    Post subject:
Reply with quote

Ok, I guess that's a valid reason why you care. But, in general, if you want to know something about DFSORT, I'd prefer that you ask the question in the DFSORT Forum. I tend not to participate in discussions specifically about Syncsort (although I may do so to correct or question something when appropriate, as in this case).
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 syncsort: copy lines after the keyword shreya19 SYNCSORT 1 Fri Dec 02, 2016 9:47 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am


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