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
 

 

Want to sort on the following scenario using SYNCSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
bshkris

New User


Joined: 21 Mar 2005
Posts: 29
Location: pune

PostPosted: Wed Jan 17, 2007 9:04 pm    Post subject: Want to sort on the following scenario using SYNCSORT
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

Site Director


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

PostPosted: Wed Jan 17, 2007 9:17 pm    Post subject:
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: 29
Location: pune

PostPosted: Tue Jul 08, 2014 1:02 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


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