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

Need help with simple report........


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

New User


Joined: 03 Jul 2006
Posts: 55

PostPosted: Thu Jul 15, 2010 2:30 am
Reply with quote

I spent some time reading manuals but still............
Maybe somebody has similar example.

This is my input (I simplified to make it easier)..

Code:

----+----1----+----2----+----
NAME1    100       010       
NAME2    100       010       
NAME3    100       010       
NAME4    100       010       
NAME5    100       010       

I need to produce report like this (it has to be in CSV format so I insert ").
Trailer has to sum some fields.


Code:

      REPORT NAME GOES HERE    DATE: 2010-07-14
        "100"     "010"                       
        "100"     "010"                       
        "100"     "010"                       
        "100"     "010"                       
        "100"     "010"                       
TOTAL:  "500"     "050"                       


Thank you.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Jul 15, 2010 2:59 am
Reply with quote

rmd3003,

Use the following DFSORT JCL

Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                               
----+----1----+----2----+----3----+----4----+----5----+----6---
NAME1    100       010                                         
NAME2    100       010                                         
NAME3    100       010                                         
NAME4    100       010                                         
NAME5    100       010                                         
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                               
  SORT FIELDS=COPY                                             
  OUTFIL REMOVECC,                                             
  BUILD=(9:C'"',10,3,C'"',19:C'"',20,3,C'"',80:X),             
  HEADER1=(7:'REPORT NAME GOES HERE    DATE: ',DATE=(4MD-)),   
  TRAILER1=('TOTAL',X,                                         
            TOT=(10,3,ZD,EDIT=("IIIIT)),'"',2X,               
            TOT=(20,3,ZD,EDIT=("IIIIT)),'"')                   
//*
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: Thu Jul 15, 2010 3:34 am
Reply with quote

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
NAME1    100       010
NAME2    100       010
NAME3    100       010
NAME4    100       010
NAME5    100       010
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  OPTION COPY
  OUTFIL REMOVECC,
    HEADER1=(7:'REPORT NAME GOES HERE',
        32:'DATE: ',DATE=(4MD-)),
   BUILD=(9:C'"',10,3,C'"',19:C'"',20,3,C'"',80:X),
   TRAILER1=('TOTAL:',9:C'"',TOTAL=(10,3,ZD,TO=ZD,LENGTH=3),
                     19:C'"',TOTAL=(20,3,ZD,TO=ZD,LENGTH=3),
    C'"')
/*
Back to top
View user's profile Send private message
rmd3003

New User


Joined: 03 Jul 2006
Posts: 55

PostPosted: Thu Jul 15, 2010 6:24 am
Reply with quote

Wow, awesome guys. Thank you very much.
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 help on formatting a report DFSORT/ICETOOL 14
No new posts Creating Report using SORT DFSORT/ICETOOL 7
No new posts Ca7 long running jobs report All Other Mainframe Topics 1
No new posts Report of batch jobs JCL & VSAM 1
No new posts Run a simple JOB as Started Task All Other Mainframe Topics 4
Search our Forums:

Back to Top