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
 

 

A specific Requirement in SORT

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

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Wed Nov 30, 2011 2:58 pm    Post subject: A specific Requirement in SORT
Reply with quote

Dear Experts,

Please suggest me, How to write the SYNCSORT for the below requirement

Input file looks like
ABINPDD1.....cm..Ç....ï....ï...b.{â.
ABINPDD1...|."...Z.............b.Gâ.
ABINPDD1...?...¼.Ô....&....&...b.óâ.
ABINPDD1..."..)â.|....ë....ë...b.Oâ.
ABINPDD1......Ãz.>.............b.Uâ.
ABINPPRF......É[.F.............b._â.
ABINPPRF.....bMr.Ï....ñ....ñ...b.Ëâ.
ABINPPRF...|.Ø¥Í.e.............b.Ìâ.
ACKBSIF0.....ae..¼.............b.{â.
ACKBSIF0...|.=.ë.*....î....î...b.Gâ.
ACKBTRL1...?...¹...............b.ÿâ.
ACKBTRL1...?.Ø...T.............b.Uâ.
ACKBTRL2...¤..Î................b.3â.
ACKBTRL2..............à....á...b..â.
ACKBTS01...?."3................b.ßâ.
ACKBTS01...".a7..i.........ï...b./â.
ACKBTS02...?."3................b.ßâ.
ACKBTS02...".a7..i.........ï...b./â.
ACKBTS02......¡..¬.............b._â.
ACKBTS03.....a.n.+.............b.{â.
ACKBTS03...|.@â@.:.............b.Gâ.

From the Input file, I'm interested in only 2 fields,
The first field is CUSTOMER-ID and is of 8-char
and the second field is CODE at positions 29-30 (Unisigned Packed).

A Single CUSTOMER-ID may have more than one row in a file.
Lets assume there is one row for each customer-no whenever he/she make a transaction in a particular month along with the CODE (it may differs after every transaction). The CODE value ranges from 00 - 12


I want to write an output file as follows:
ABINPDD1;00
ABINPPRF;00
ACKBSIF0;00
ACKBTRL#;00
ACKBTS##;00


Criteria:
1) If Customer Numbers
between the range ACKBTRL1 & ACKBTRL2 I want a row with Customer-No in the output file as ACKBTRL#

2) If the Customer Numbers
between the range ACKBTS01 & ACKBTS27
I want a row with the Customer-No in the output file as ACKBTS##

4) CODE is in a Un-signed Packaed decimal format, and like to convert it into the zoned decimal and like to print the maximum of all the CODE's for each CUSTOMER (or) CUSTOMER-Number Range as specified in the points 1 & 2

I will be waiting for your kind reponse.
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10276
Location: italy

PostPosted: Wed Nov 30, 2011 3:06 pm    Post subject: Reply to: A specific Requirement in SORT
Reply with quote

Quote:
How to write the SYNCSORT for the below requirement

topic moved to the proper forum section
Back to top
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Wed Nov 30, 2011 4:03 pm    Post subject:
Reply with quote

Please show us the code you tried and what error you are facing.
Back to top
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Wed Nov 30, 2011 4:20 pm    Post subject:
Reply with quote

If you have not tried anything... suggest you take a look at IFTHEN parameter to check the range and build the output. Edit parameter to convert the packed field to readable format.

Skeleton would be

Code:
SORT FIELDS=COPY                                                       
OUTREC IFTHEN=(WHEN=(range ACKBTRL1 & ACKBTRL2),
       BUILD=(ACKBTRL#)),             
       IFTHEN=(WHEN=( ACKBTS01 & ACKBTS27),
       BUILD=(ACKBTS##)),             
       IFTHEN=(WHEN=NONE,                                             
       BUILD=(values from input))                         
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Wed Nov 30, 2011 6:16 pm    Post subject:
Reply with quote

Hi kratos86,

I tried with WHEN=GROUP,BEGIN=(...

The IFTHEN did not work for me.

Is there any alternative either in DFSORT / SYNCSORT ?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1771
Location: Bloomington, IL

PostPosted: Wed Nov 30, 2011 7:33 pm    Post subject:
Reply with quote

mkk157 wrote:
Hi kratos86,

I tried with WHEN=GROUP,BEGIN=(...

The IFTHEN did not work for me.

Is there any alternative either in DFSORT / SYNCSORT ?

Since you won't tell us how it doesn't work, we can't tell you how to change it so that it does, or what alternatives there might be. Too bad, so sad.
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 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