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
 

 

Sort problem in generaring the report

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Sort problem in generaring the report
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 Moderator


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

PostPosted: Tue Feb 02, 2010 12:27 am    Post subject:
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    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 Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm


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