Posted: Fri May 06, 2011 11:40 am Post subject: REPORTING USING ICETOOL (PREFERABLY)
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
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.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Fri May 06, 2011 12:13 pm Post subject:
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.
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.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Fri May 06, 2011 2:57 pm Post subject:
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))
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