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

How to generate a report like this


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

New User


Joined: 10 Mar 2005
Posts: 81

PostPosted: Tue Jul 17, 2007 1:29 pm
Reply with quote

I have an input file like this

KEY1 *
KEY2 *
KEY3
KEY4
KEY5 *
KEY6 *

My output file looks like this -- for each input record with '*' i have 2 records in the output file as 'KEY1' and 'KEY1 *'.

KEY1
KEY1 *
KEY2
KEY2 *
KEY3
KEY4
KEY5
KEY5 *
KEY6
KEY6 *

I need to create reports like this

1) Report from Input file
Count of '*' and ' ' records. I am doing like

OCCURS FROM(INDD) LIST(OUTDD) -
HEADER('ASTREIX') ON(6,1,CH) -
HEADER('COUNTS') ON(VALCNT,A1,N06)

ASTREIX COUNTS
2
* 4

But the count for ' ' should be 2 + 4 = 6(for each '*' there is one with ' ' -- see output file).
(a) I need to check if the count from input file is same as that in output.
(b) Also if there are any records in Input file not in output

How to accomplish this? Can anybody help.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Jul 17, 2007 2:02 pm
Reply with quote

kalukakkad

Quote:
My output file looks like this

Have you already obtained this o/p?

Quote:
But the count for ' ' should be 2 + 4 = 6(for each '*' there is one with ' ' -- see output file).
Please explain this a bit more icon_rolleyes.gif
Back to top
View user's profile Send private message
kalukakkad

New User


Joined: 10 Mar 2005
Posts: 81

PostPosted: Tue Jul 17, 2007 2:12 pm
Reply with quote

No, i haven't.

OCCURS FROM(INDD) LIST(OUTDD) -
HEADER('ASTREIX') ON(6,1,CH) -
HEADER('COUNTS') ON(VALCNT,A1,N06)

Gives me 2 as a count for KEYs without '*'. I have to get it as 6. How to do it.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Jul 17, 2007 2:16 pm
Reply with quote

kalukakkad,
Quote:
I have to get it as 6. How to do it.

Still unclear.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Jul 17, 2007 3:20 pm
Reply with quote

kalukakkad
Quote:
My output file looks like this

The ICETOOL solution for generating
Code:
----+----1
**********
KEY1     
KEY1 *   
KEY2     
KEY2 *   
KEY3     
KEY4     
KEY5     
KEY5 *   
KEY6     
KEY6 *   

is
Code:
//*******************************************************               
//STEP001  EXEC PGM=ICETOOL                                             
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//IN1      DD *                                                         
KEY1 *                                                                 
KEY2 *                                                                 
KEY3                                                                   
KEY4                                                                   
KEY5 *                                                                 
KEY6 *                                                                 
/*                                                                     
//OUT1     DD SYSOUT=*                                                 
//TOOLIN   DD *                                                         
 COPY FROM(IN1)  USING(CP01)                                   
/*                                                                     
//CP01CNTL DD   *                                                       
  OUTFIL FNAMES=OUT1,IFTHEN=(WHEN=(6,1,CH,EQ,C'*'),
     BUILD=(1,4,/,1,6))   
/*                                                                     
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Jul 17, 2007 3:24 pm
Reply with quote

kalukakkad
Regarding this
Quote:
Gives me 2 as a count for KEYs without '*'. I have to get it as 6. How to do it.

As per my understanding you want count of all the records in the O/p, which do not have '*' in front of them right?
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Jul 17, 2007 4:03 pm
Reply with quote

kalukakkad
The complete DFSORT/ICETOOL solution for your question is here:
Code:
//*******************************************************               
//STEP001  EXEC PGM=ICETOOL                                             
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//IN1      DD DSN=... i/p file                                                         
//OUT1     DD DSN=... o/p file
//REPORT   DD SYSOUT=*                                                 
//TOOLIN   DD *                                                         
 COPY FROM(IN1) USING(CP01)                                   
 OCCURS FROM(OUT1) LIST(REPORT) -                                       
 HEADER('ASTREIX') HEADER('COUNTS') -                                   
 ON(6,1,CH) ON(VALCNT,N06)                                             
/*                                                                     
//CP01CNTL DD   *                                                       
  OUTFIL FNAMES=OUT1,IFTHEN=(WHEN=(6,1,CH,EQ,C'*'),
       BUILD=(1,4,/,1,6))   
/*                                                                     

o/p Report:
Code:
----+----1----+----2
ASTREIX    COUNTS   
-------   -------   
                6   
*               4   
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 Generate random number from range of ... COBOL Programming 3
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