View previous topic :: View next topic
|
Author |
Message |
gokuldass
New User
Joined: 18 Mar 2005 Posts: 48 Location: india
|
|
|
|
How to get previous record value in rexx user exit written.
I am having a dataset like this..
10
15
17
25
I want my output like this..
10 0
15 5 == ( current record value = 15 - previous record value = 10)
17 2
25 8
How to get this desired output through sort.
Thx in advance. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
I've moved your post to JCL part of the Forum, as SyncSort questions are discussed there and your subject line talk about SyncSort.
Also, I don't understand what exact solution are you looking for as I see two different questions there:
Question 1:
Quote: |
How to get previous record value in rexx user exit written. |
Question 2:
Quote: |
How to get this desired output through sort. |
I might have misunderstood, however request you to clarify please. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Anuj, typing it so does not make it so :-) |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
For a Saturday night at around 10:30 IST, you were too fast for me, Bill.
Thanks! |
|
Back to top |
|
|
gokuldass
New User
Joined: 18 Mar 2005 Posts: 48 Location: india
|
|
|
|
I tried to get the desired output mentioned in my initial question through syncsort with SYGBLSTRP option in rexx user exit. It did not work for me. So curious to know how to use SYGBLSTRP.
I would also welcome if anyother solution could give me my desired output other than syncsort option that I tried.
Thx,
Gokul Dass |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Quote: |
It did not work for me |
Not exactly informative. How did it not work for you? As far as I can see, SYGBLSTRP is not an OPTION but a Syncsort supplied variable. According to my research the length of data placed in that variable cannot exceed 1024 bytes and is apparently documented in chapter 7 (coding rexx exits) in the syncsort manual. (Thanks Kolusu, I stole that bit of info from your forum!) |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
If you feel the need to use an EXIT, just save the value of the "current" record, and use it to calculate the difference when you get the "next" record.
The updating could be attempted by passing the data back to SyncSort, but why bother since you have all the information in your EXIT to update the then "current" record?
However, there shouldn't be need of an EXIT at all. Your task can be achieved with IFTHEN=(WHEN=GROUP, assuming your SyncSort is sufficiently up-to-date. So let us know. |
|
Back to top |
|
|
|