MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

REPORTING USING ICETOOL (PREFERABLY)

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
spalanis
Beginner


Joined: 19 Jul 2006
Posts: 32
Topics: 15

PostPosted: Fri May 06, 2011 11:40 am    Post subject: REPORTING USING ICETOOL (PREFERABLY) Reply with quote

My Input looks like:
Code:

A-02 DISCREPANCY FOR DEPT : 12345 FOR THE STUDENT IN
A-02ACLASS: 5A
N-05 STUDENT SRINI ASSIGNED TO CLASS : 5A
N-05 STUDENT SRINI ASSIGNED TO CLASS : 5B
N-05 STUDENT SRINI ASSIGNED TO CLASS : 5C
N-05 STUDENT SRINI ASSIGNED TO CLASS : 5D
N-05 STUDENT SRINI ASSIGNED TO CLASS : 5E
N-05 STUDENT SRINI ASSIGNED TO CLASS : 5F
N-05 STUDENT SRINI ASSIGNED TO CLASS : 5G
N-05 STUDENT SRINI ASSIGNED TO CLASS : 5H
V-09 POLICY: 1316663772    IS ASSOCIATED TO CLM1
V-09 POLICY: 1316663773    IS ASSOCIATED TO CLM2
V-09 POLICY: 1316663774    IS ASSOCIATED TO CLM3
V-09 POLICY: 1316663775    IS ASSOCIATED TO CLM4
V-09 POLICY: 1316663776    IS ASSOCIATED TO CLM5
V-09 POLICY: 1316663777    IS ASSOCIATED TO CLM6
V-09 POLICY: 1316663778    IS ASSOCIATED TO CLM7


My OUTPUT should be :
Code:

DISC   DEPT    CLASS
A-02   12345   5A

DISC   STUDENT CLASS
N-05   SRINI   5A
N-05   SRINI   5B
N-05   SRINI   5C
N-05   SRINI   5D
N-05   SRINI   5E

DISC   POLICY      CLAIM
V-09   1316663772  CLM1
V-09   1316663773  CLM2
V-09   1316663774  CLM3
V-09   1316663775  CLM4
V-09   1316663776  CLM5

Requirement Notes:
1. If there is any character in 5th byte, then the row is continuation row to previous row. Ex: A-02
2. Output should be in report format where the fields vary for each discrepancy. The report fields can be on any position in single line(V-09 & N-05) or can present across multiple lines as well(A-02).
3. For each of the discrepancy (V-09,N-05 & A-02), I should limit the report counts to maximum of 5 rows. This is requirement for sampling report.
4. Input file is FB file

Please note:
I can achieve this using PLI or COBOL programming. BUt just curious to find a way of achieving it through ICETOOL or any of the SORT utilities.

Thanks in advance.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri May 06, 2011 12:13 pm    Post subject: Reply with quote

spalanis,

Your headers are off. For A-02 record you had the DEPT from the previous record and for N-05 and V-09 you had the header from the same line. Do you process A-02 separately? It would help us if you provided the format and length of the key break fields and also LRECL of the input/output fields. I added the code tags for your data.

Enclose your data between code tags so that it is easy to read and also the formatting is retained.
Code:
[code] your data here[/code]

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
spalanis
Beginner


Joined: 19 Jul 2006
Posts: 32
Topics: 15

PostPosted: Fri May 06, 2011 1:28 pm    Post subject: Reply with quote

Hi Kolusu,

Yes. For A-02 I have headers present in two rows.
The above data is just a sample data. You can use the data as is. For convenience, you can use LRECL as 132 for both files.

Sure Kolusu. I will encode data in code format from next time. Thanks for doing it this time.
Back to top
View user's profile Send private message
spalanis
Beginner


Joined: 19 Jul 2006
Posts: 32
Topics: 15

PostPosted: Fri May 06, 2011 1:30 pm    Post subject: Reply with quote

I meant, any key length will do. I will refer the solution and will enhance further to fit my requirements.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri May 06, 2011 2:57 pm    Post subject: Reply with quote

spalanis,

Use the following DFSORT JCL which will give you the desired results


Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                                 
----+----1----+----2----+----3----+----4----+----5----+----6----
A-02 DISCREPANCY FOR DEPT : 12345 FOR THE STUDENT IN           
A-02ACLASS: 5A                                                 
N-05 STUDENT SRINI ASSIGNED TO CLASS : 5A                       
N-05 STUDENT SRINI ASSIGNED TO CLASS : 5B                       
N-05 STUDENT SRINI ASSIGNED TO CLASS : 5C                       
N-05 STUDENT SRINI ASSIGNED TO CLASS : 5D                       
N-05 STUDENT SRINI ASSIGNED TO CLASS : 5E                       
N-05 STUDENT SRINI ASSIGNED TO CLASS : 5F                       
N-05 STUDENT SRINI ASSIGNED TO CLASS : 5G                       
N-05 STUDENT SRINI ASSIGNED TO CLASS : 5H                       
V-09 POLICY: 1316663772    IS ASSOCIATED TO CLM1               
V-09 POLICY: 1316663773    IS ASSOCIATED TO CLM2               
V-09 POLICY: 1316663774    IS ASSOCIATED TO CLM3               
V-09 POLICY: 1316663775    IS ASSOCIATED TO CLM4               
V-09 POLICY: 1316663776    IS ASSOCIATED TO CLM5               
V-09 POLICY: 1316663777    IS ASSOCIATED TO CLM6               
V-09 POLICY: 1316663778    IS ASSOCIATED TO CLM7               
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                             
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(133:C'DISCSTUDENTCLASS')),   
  IFTHEN=(WHEN=GROUP,BEGIN=(6,11,CH,EQ,C'DISCREPANCY'),         
  RECORDS=2,PUSH=(149:29,5)),                                   
  IFTHEN=(WHEN=(6,5,CH,EQ,C'CLASS'),                           
  OVERLAY=(137:C'DEPT   ',159:13,4)),                           
  IFTHEN=(WHEN=(6,7,CH,EQ,C'STUDENT'),                         
  OVERLAY=(149:14,5,5X,40,4)),                                 
  IFTHEN=(WHEN=(6,6,CH,EQ,C'POLICY'),                           
  OVERLAY=(137:C'POLICY ',149:14,10,45,4))                     

  OUTFIL OMIT=(6,11,CH,EQ,C'DISCREPANCY'),REMOVECC,             
  BUILD=(1,4,08:149,10,20:159,4,132:X),                         
  SECTIONS=(133,16,                                             
  HEADER3=(01:133,4,08:137,7,20:144,5),                         
  TRAILER3=(132X))                                             
//*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
spalanis
Beginner


Joined: 19 Jul 2006
Posts: 32
Topics: 15

PostPosted: Wed May 11, 2011 11:31 am    Post subject: Reply with quote

Thanks a Lot Kolusu.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group