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
 

 

Multiple sorting one file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Anand78

New User


Joined: 06 Mar 2006
Posts: 50
Location: PUNE

PostPosted: Fri Oct 26, 2007 10:53 am    Post subject: Multiple sorting one file
Reply with quote

I want to sort file using DFSORT in one step, not with more than one step , Please look into the rules.
Rules:

1. sum up based on fields grd-cd, mbank-cd,fee-id and fee-cd
2. sum up based on fields grd-cd, fee-id and fee-cd, low values
to be moved field mbank-cd.
3. sum up based on fields fee-id and fee-cd, low values
to be moved field grd-cd and mbank-cd.

Please fine attached XLS for data.

Thnaks
Anand
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Fri Oct 26, 2007 11:00 am    Post subject:
Reply with quote

Anand,

How many O/P files are you expecting? Is it one or three?
Back to top
View user's profile Send private message
Anand78

New User


Joined: 06 Mar 2006
Posts: 50
Location: PUNE

PostPosted: Fri Oct 26, 2007 11:04 am    Post subject: Multiple Sorting
Reply with quote

Any way in one or three output files, if it is possible in one output file , it will be more better ,
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Fri Oct 26, 2007 7:15 pm    Post subject:
Reply with quote

Anand78 ,

Please check with the following code for your requirement.
Code:
// EXEC PGM=ICETOOL                                                     
//DFSMSG DD SYSOUT=*                                                   
//TOOLMSG DD SYSOUT=*                                                   
//IN DD *                                                               
260260FM74020.5                                                         
260260FM74010.0                                                         
260260FM74082.5                                                         
260260FM74055.0                                                         
260260FM74045.0                                                         
260260FM74112.0                                                         
260260FM74062.5                                                         
260260FM74030.0                                                         
260260FM74042.5                                                         
260260FM74005.0                                                         
260260FM74060.0                                                         
260260FM74050.0                                                         
260261FM74082.5                                                         
//OUT DD DSN=OUT,DISP=(MOD,CATLG),
// DCB=(IN),SPACE=(...),...                                                       
//TOOLIN DD *                                                           
  COPY FROM(IN) TO(OUT) USING(CTL1)                                     
  COPY FROM(IN) TO(OUT) USING(CTL2)                                     
  COPY FROM(IN) TO(OUT) USING(CTL3)                                     
 /*                                                                     
 //CTL1CNTL DD *                                                         
  OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,                                   
  SECTIONS=(1,10,TRAILER3=(1,10,TOT=(11,5,SFF,EDIT=(TTTT.T))))           
 /*                                                                     
 //CTL2CNTL DD *                                                         
  OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,                                   
  SECTIONS=(1,3,7,4,TRAILER3=(1,3,3X,7,4,TOT=(11,5,SFF,EDIT=(TTTT.T)))) 
 /*                                                                     
 //CTL3CNTL DD *                                                         
  OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,                                   
  SECTIONS=(7,4,TRAILER3=(6X,7,4,TOT=(11,5,SFF,EDIT=(TTTT.T))))         
 /*                                                                     
 //                                                                     

Output:
Code:
260260FM740575.0                                                               
260261FM740082.5                                                               
260   FM740657.5                                                               
      FM740657.5                                                               
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Oct 26, 2007 11:29 pm    Post subject:
Reply with quote

Anand,

Shankar's job won't help because he assumes that every record has the key fields (grd-cd, mbank-cd,fee-id and fee-cd) whereas your example clearly shows some don't.

What is the RECFM and LRECL of the input file?

What is the starting position, length and format of the grd-cd, mbank-cd, fee-id, fee-cd and amount fields?

Please show a more extensive example of input records and expected output records, with multiple groups of fields having different key values (grd-cd, mbank-cd,fee-id and fee-cd) - for example, records with different grd-cd, fee-id and fee-cd values and with different fee-id and fee-cd values. It's difficult to get the full picture of what you want from just those few records you showed. Please don't attach a file, just show the relevant values inline using code tags, e.g.

Code:

INPUT
GRP-CD  MBANK-CD        FEE-ID  FEE-CD  Amount
260     260             F       M74     20
                                        10
                                        82.5
                                        55
                                        45
                                        112.5
                                        62.5
                                        30
                                        42.5
                                        5
                                        60
                                        50
260     261             F       M74     82.5

OUTPUT
GRP-CD  MBANK-CD        FEE-ID  FEE-CD  Amount
260     260             F       M74     575
260     261             F       M74     82.5

260                     F       M74     657.5

                        F       M74     657.5
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am


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