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

Multiple sorting one file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 1436
Location: Bangalore,India

PostPosted: Fri Oct 26, 2007 11:00 am
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
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
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 Developer


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

PostPosted: Fri Oct 26, 2007 11:29 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top