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

Sort problem in generaring the report


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
harithaganna

New User


Joined: 03 Jun 2008
Posts: 14
Location: chennai

PostPosted: Mon Feb 01, 2010 12:08 pm
Reply with quote

Hi,
I have a problem in generaring the report? Can someone help me?

My input file contains 3 fields. field1=x(16), amt=pic s9(7)v99 comp-3, tran=x(4)

I/P:
field1 amt tran
xxx 50 4000
yyy 50 4001
aaa 50 4002
bbb 50 4000
ccc 50 4001
ddd 50 4004

I want to create report based upon the tran.


O/P:

field1 amt tran
xxx 50 4000
bbb 50 4000
sub tot:100 count:2

yyy 50 4001
ccc 50 4001
sub tot:100 count:2

aaa 50 4002
sub tot: 50 count:1

ddd 50 4004
sub tot: 50 count:1


grand tot:300 count:6
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: Tue Feb 02, 2010 12:27 am
Reply with quote

Quote:
My input file contains 3 fields. field1=x(16), amt=pic s9(7)v99 comp-3, tran=x(4)


That means your fields would actually be like this:

field1 - positions 1-16 (CH)
amt - positions 17-21 (PD)
tran - positions 22-24 (CH)

Assuming you wanted to display the PD fields as ddddddd.dd corresponding to s9(7)v99, you could use a DFSORT job like the following:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  SORT FIELDS=(22,4,CH,A)
  OUTFIL REMOVECC,
    BUILD=(1,16,17:17,5,PD,EDIT=(IIIIIIT.TT),X,22,4,80:X),
    SECTIONS=(22,4,
      TRAILER3=(7:'sub tot:',TOT=(17,5,PD,EDIT=(IIIIIIT.TT)),
       32:'count:',COUNT)),
      TRAILER1=(7:'grand tot:',TOT=(17,5,PD,EDIT=(IIIIIIT.TT)),
       32:'count:',COUNT)
/*


SORTOUT would look like this:

Code:

xxx                  50.00 4000                   
bbb                  50.00 4000                   
      sub tot:    100.00       count:       2     
yyy                  50.00 4001                   
ccc                  50.00 4001                   
      sub tot:    100.00       count:       2     
aaa                  50.00 4002                   
      sub tot:     50.00       count:       1     
ddd                  50.00 4004                   
      sub tot:     50.00       count:       1     
      grand tot:    300.00     count:       6     
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 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 Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top