View previous topic :: View next topic
|
Author |
Message |
Purnendu.it
New User
Joined: 11 May 2007 Posts: 57 Location: chennai
|
|
|
|
HI,
below is my requirement.
I am reading a input file(in1) and creating a report(r1).
the layout of the input is:
01 input rec.
03 field1 pic x(05)
03 fileld2 pic x(02)
03 field3 pic x(02)
03 field4 pic x(02)
03 error-codes pic x(50).
value in the error code can is 01,02,03,04,32,06,76,08,09,10
or it can be 01,02,03 or any combination but maximum no. of error
codes can be upto 10.
now while writing to report my report should look like
Code: |
[code] ***report header**
field1 field2 field3 field4 error-code error-message
aaaaa aa aa aa 01 eligibility missing
02 invalid code
03 client code
32 referece id
bbbbb bb bb bb 03 client code
32 reference id
************report tralier*****************[/code] |
A single record can contain the max error code or 10 ...
can anyone pls give the logic while reading the record
how i will see the error codes and how i will print
the error message in the report along with their corresponding
error codes.
Thank you.
|
|
Back to top |
|
|
Binop B
Active User
Joined: 18 Jun 2009 Posts: 407 Location: Nashville, TN
|
|
|
|
Hi Purnendu,
Could give a sample of the input record.
Am not clear on what value the error-codes field will have exactly.
Also, the error-message you have given as part of the report, where do we get that description. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Can error-codes be 1,2,3 or are they always 01,02,03?
If the latter, redefine error-codes as
Code: |
03 error-codes-r redefines error-codes
occurs 16.
05 error-code-x pic x(02).
05 error-code-no redefines error-code-x
pic 9(02).
05 filler pic x(01). |
and process until error-code-x (?) = spaces. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Quote: |
Also, the error-message you have given as part of the report, where do we get that description. |
If using Robert's solution, you can define the 10 error messages in an internal table and use error-code-no as a subscript into the table to retrieve the description. |
|
Back to top |
|
|
Binop B
Active User
Joined: 18 Jun 2009 Posts: 407 Location: Nashville, TN
|
|
|
|
Terry Heinze wrote: |
Quote: |
Also, the error-message you have given as part of the report, where do we get that description. |
If using Robert's solution, you can define the 10 error messages in an internal table and use error-code-no as a subscript into the table to retrieve the description. |
Yup... very true... but am not entirely sure that's how the input is...
When i read the post first time... the description was actually part of the input message... though now it looks unlikely... |
|
Back to top |
|
|
|