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
 

 

Report generation problem

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 193
Location: india

PostPosted: Fri May 07, 2010 12:46 pm    Post subject: Report generation problem
Reply with quote

Hello,

I am having a requrement to extract the data
form the file to generate the report :-

INPUT FILE:-

Record format . . . : FB
Record length . . . : 80

Code:
CA    ACC01   1020
GA    ACC02   1020
CA    ACC03   8922
CA    ACC04   8924
GA    ACC08   8924
CA    ACC00   8393
CA    ACC06   9893
CA    ACC70   8935 
GA    ACC89   8935


REPORT :-

Code:
CA      AMT      GA      AMT
--      ----     ----    ----
ACC01   1020     ACC02   1020
ACC03   8922     
ACC04   8924     ACC08   8924
ACC00   8393
ACC06   9893
ACC70   8935     ACC89   8935


Rules:--

The records are in a sequence whenever
there is a GA record after CA then
the records should merge as depicted
above.

Thank you,
Rajat
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: Fri May 07, 2010 7:26 pm    Post subject:
Reply with quote

Hello,

What if there are 50 2-char values (i.e. CA, GA, FG, HY, etc) and the data is too wide for a report line?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri May 07, 2010 11:02 pm    Post subject:
Reply with quote

Rajat,

Assuming you only have 'CA' and "GA' records as shown, you can use a DFSORT/ICETOOL job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//IN DD *
CA    ACC01   1020
GA    ACC02   1020
CA    ACC03   8922
CA    ACC04   8924
GA    ACC08   8924
CA    ACC00   8393
CA    ACC06   9893
CA    ACC70   8935
GA    ACC89   8935
/*
//OUT DD SYSOUT=*
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(81,8,ZD) KEEPNODUPS -
  WITH(18,5) WITH(26,4) USING(CTL1)
/*
//CTL1CNTL DD *
   INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,2,CH,EQ,C'CA'),
     PUSH=(81:ID=8)),
    IFTHEN=(WHEN=(1,2,CH,EQ,C'CA'),
     BUILD=(1:7,5,9:15,5,81:81,8)),
    IFTHEN=(WHEN=(1,2,CH,EQ,C'GA'),
     BUILD=(18:7,5,26:15,5,81:81,8))
   OUTFIL FNAMES=OUT,REMOVECC,BUILD=(1,80),
     HEADER2=('CA      AMT      GA      AMT',/,
              '--      ----     ----    ----')
/*
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 193
Location: india

PostPosted: Fri May 07, 2010 11:03 pm    Post subject:
Reply with quote

Hello,

We have one only two char values CA and GA .

Thank You,
Rajat
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri May 07, 2010 11:04 pm    Post subject:
Reply with quote

Then the solution I provided should work for you.
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 193
Location: india

PostPosted: Fri May 07, 2010 11:20 pm    Post subject:
Reply with quote

Hello,

Thanks a lot, It is giving me the expected results. Please explain me the below coded statement in your JCL

Code:
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,2,CH,EQ,C'CA'),
     PUSH=(81:ID=8)),


Rajat
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri May 07, 2010 11:43 pm    Post subject:
Reply with quote

For complete details on DFSORT's WHEN=GROUP function, see:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000085
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 SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts Strings with double quotes having pro... raja Arumugam All Other Mainframe Topics 11 Thu Mar 30, 2017 10:34 am
No new posts Splitting of single report to seperat... abdulrafi TSO/ISPF 7 Mon Mar 27, 2017 3:59 pm
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts Easytrieve report shalem CA Products 4 Sun Feb 26, 2017 9:08 am


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