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

Want to sort on the following scenario using SYNCSORT


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bshkris

New User


Joined: 21 Mar 2005
Posts: 41
Location: pune

PostPosted: Wed Jan 17, 2007 9:04 pm
Reply with quote

Hi,

I am using SYNCSORT utility. I have a challange that i using one input file of length 2500 bytes, and o/p file also having same length.
in input file i have Cliam-Id &Timestamp as fields. Along with theese fields so many fields are presented.
My requirement is i want to sort on the following scenario.
i/p file--
claim id Time stamp
-------- -------------
1234 2002101010
1234 2002103030
1234 2010104999
1235 2010104998


o/p file
------
1234
1235
ws-skip cnt : 1
ws read: 3

The claim id should sorted in ascending, and if it finds more duplicates ,in that case Time stamp should be sorted in Decending order.

Thanks,
Hari
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: Wed Jan 17, 2007 9:17 pm
Reply with quote

Hello,

Just define 2 sort fields. Make the claim-id ascending and the time-stamp descending. It will not matter if there are duplicates in the claim-id.
Something like:
Code:
 SORT FIELDS=(1,4,CH,A,6,10,CH,D), etc. . .

should do what you want.
Back to top
View user's profile Send private message
bshkris

New User


Joined: 21 Mar 2005
Posts: 41
Location: pune

PostPosted: Tue Jul 08, 2014 1:02 pm
Reply with quote

Hi,

I have 2 date feilds in input file.
Let say the date feilds starts in below positions

Length start pos end pos
DATE1 10 308 317
DATE2 10 318 327

I have date1 value 2014-09-23. Now i want to add 9months to date1 and place it in date2 feild.

I was able to calculate 1 year to date1 but failed to add 9 months.

The below is sort card for adding one year.
OUTREC FIELDS=(1,317,318,4,ZD,ADD,+1,EDIT=(TTTT),322,29)
the file's total length is 350 bytes, our date feilds exists from 308 to 327 bytes.

If any one has idea how to do calculate the 9 months advanced date from given input value by using sort card, please let me know.
Appriciate your help.

Thanks.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Tue Jul 08, 2014 6:40 pm
Reply with quote

Please start a new topic instead of adding onto a 7-yr old one.
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top