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

A specific Requirement in SORT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Nov 30, 2011 3:06 pm
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
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
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
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: 1788
Location: Bloomington, IL

PostPosted: Wed Nov 30, 2011 7:33 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


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 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
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top