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
 

 

small problem in generating 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 Mar 29, 2010 5:24 pm    Post subject: Outfil Fields
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    Post subject:
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

Site Director


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

PostPosted: Mon Mar 29, 2010 11:19 pm    Post subject:
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    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 SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm
No new posts Detailed Transaction History report f... Kyle Carroll CICS 5 Tue Oct 18, 2016 12:42 am
No new posts DB2 Streaming Batch Processing Problem Manshadi DB2 4 Sat Sep 24, 2016 12:14 pm


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