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

Please Let me know if you have the DFSORT solution.


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

New User


Joined: 15 Feb 2007
Posts: 8
Location: India

PostPosted: Fri Feb 16, 2007 5:48 pm
Reply with quote

Please Let me know if you have the DFSORT solution for the following report creation problem.

Input File looks like as follows Except for the first row:

Code:

Region  Branch  Data
98  J2 Data1J298
98  J2 Data2J298
98  J2 Data3J398
98  L8 DATA1L898
98  L8 DATA2L898
98  U6 DataU698
12  T2 DataT212
12  D8 DataD812
13  74  Data7413
QW 45 Data45QW
QW 12 Data12Qw


I want the output report to Look like as follows :

Code:

Branch J2
1                    Data1J298
2                    Data2J298
3                    Data3J298
Total: 3
------------------------------
Branch L8
1                    Data1L898
2                    Data2L898
Total: 2
------------------------------
Branch U6
1                    DataU698
Total 1
-----------------------------
Region 98
            Branch/Region              Total
            Branch  J2                                3         
            Branch L8                                2
            Branch U6                                1         
            Region 98                                 6
----------------------------------------------------
Branch  T2       
1                    DataT212
Total 1
-----------------------------
Branch  D8
1                    DataD812
Total 1
------------------------------
Region 12         
            Branch/Region              Total
            Branch  T2                               1         
            Branch D8                                1
            Region 12                                 2
-----------------------------------------------------


In the same way, it should continue for the remaining branches and regions.
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 Feb 23, 2007 11:58 pm
Reply with quote

Hmmm ... this is a tough one. The DFSORT job below will get you the two parts of the report as two different output files, but I can't figure out how to stitch them together the way you want them. You could, of course, copy and paste.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT   DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//OUT1 DD SYSOUT=*
//OUT2 DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  OUTFIL FNAMES=OUT1,REMOVECC,
    BUILD=(SEQNUM,1,ZD,RESTART=(5,2),22:8,9),
    SECTIONS=(5,2,
      HEADER3=('Branch ',5,2),
      TRAILER3=('Total:  ',COUNT=(M11,LENGTH=1),/,
        '------------------------------'))
  OUTFIL FNAMES=OUT2,REMOVECC,NODETAIL,
    HEADER2=(13:'Branch/Region',40:'Total'),
    SECTIONS=(1,2,
       TRAILER3=(13:'Region',20:1,2,
          40:COUNT=(M10,LENGTH=5),/,
        '----------------------------------------------------'),
      5,2,
        TRAILER3=(13:'Branch',20:5,2,
          40:COUNT=(M10,LENGTH=5)))
/*
Back to top
View user's profile Send private message
reddy_prn

New User


Joined: 15 Feb 2007
Posts: 8
Location: India

PostPosted: Mon Feb 26, 2007 11:06 am
Reply with quote

I wrote COBOL Program for this Problem and the problem is solved.
Thank You.
Back to top
View user's profile Send private message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Mon Feb 26, 2007 7:41 pm
Reply with quote

Input file contains only Branch name which name and region which u mentioned or still it contain some diffrent branch or region..

Plz let me knw....

so that we can do that using JCL itself........
Back to top
View user's profile Send private message
reddy_prn

New User


Joined: 15 Feb 2007
Posts: 8
Location: India

PostPosted: Tue Feb 27, 2007 9:58 am
Reply with quote

My input files is :
First 2 bytes - Region code
Next 2 bytes - Branch code
Then, Data starts for each record.
In the same region different branches can be present but vice versa is not true. There can be more than one record for each branch in the input file, but data will be different in all these records although they are from the same branch.
The input file is sorted on region and then on branch.
For every brach change, i need a report and for every region change i need a report.
Please let me know if you need additional information from me.
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
No new posts DFSORT - VB file RDW getting overridden DFSORT/ICETOOL 3
Search our Forums:

Back to Top