Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 10326
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: 1777
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 records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us