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

small problem in generating 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 Mar 29, 2010 5:24 pm
Reply with quote

Hi,
I have a small problem in generating the report. Can any one help me out? I have 2 fields ID and Code.

Input:

ID Code
000001 052
000001 052
000001 053
000002 052
000002 052
000002 053
000002 053


Output:

ID Code
000001 052
000001 052
Sub count : 2
000001 053
Sub count : 1
Total no of 000001 records : 3

000002 052
000002 052
Sub count : 2
000002 053
000002 053
Sub count : 2
Total no of 000002 records : 4
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Mon Mar 29, 2010 10:34 pm
Reply with quote

harithaganna,

You need a 2 level break report which needs 2 passes of data. Here is a DFSORT/ICETOOL job which would give you the desired results. I assumed that your input is FB recfm and lrecl of 80 and your data is already sorted on the keys.

Code:

//STEP0100 EXEC PGM=ICETOOL                                 
//TOOLMSG  DD SYSOUT=*                                       
//DFSMSG   DD SYSOUT=*                                       
//IN       DD DSN=your input FB lrecl 80 bytes file,DISP=SHR
//T1       DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE)   
//OUT      DD SYSOUT=*                                       
//TOOLIN   DD *                                             
  COPY FROM(IN) USING(CTL1)                                 
  COPY FROM(T1) USING(CTL2)                                 
//CTL1CNTL DD *                                             
  OUTFIL FNAMES=T1,REMOVECC,OVERLAY=(81:C'1'),               
  SECTIONS=(1,10,                                           
  TRAILER3=(1,10,2X,COUNT=(M10,LENGTH=8),81:C'0'))           
//CTL2CNTL DD *                                             
  OUTFIL FNAMES=OUT,IFOUTLEN=80,                             
  IFTHEN=(WHEN=(81,1,ZD,EQ,0),OVERLAY=(C'SUB COUNT :')),     
  SECTIONS=(1,6,                                             
  TRAILER3=('TOTAL NO OF ',1,6,C' RECORDS : ',               
             TOT=(81,1,ZD,M10,LENGTH=8),//))                 
//*
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Mar 29, 2010 11:19 pm
Reply with quote

Hello,

Hopefully, there are only a small number of records in the input file.

If there are hundreds of millions of records (like many of our processes), suggest the second pass is just wasted resources and some other implementation would be considered. . .
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 Map Vols and Problem Dataset All Other Mainframe Topics 2
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
Search our Forums:

Back to Top