Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to generate a report like this

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How to generate a report like this
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    Post subject:
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    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Tue Jul 17, 2007 2:16 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    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 Undefined Report Program socker_dad COBOL Programming 2 Fri Mar 30, 2018 1:45 am
No new posts How to Generate JCL using Sort naveen katkuri DFSORT/ICETOOL 7 Tue Mar 13, 2018 3:50 pm
No new posts XML Generate with Attribute & Ele... Log Thangavel COBOL Programming 5 Fri Jan 19, 2018 6:21 pm
No new posts How to select record x+7 or x+2 based... JoAnn Kulcyk SYNCSORT 6 Tue Jan 16, 2018 10:49 pm
No new posts Copying part of the report using SARBCH Aedulla CA Products 1 Tue Oct 24, 2017 9:24 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us