IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to implement this referecnce modification logic.pls help


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Purnendu.it

New User


Joined: 11 May 2007
Posts: 57
Location: chennai

PostPosted: Thu Oct 08, 2009 1:18 pm
Reply with quote

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.
Code:
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Thu Oct 08, 2009 3:24 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Oct 08, 2009 5:31 pm
Reply with quote

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
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Thu Oct 08, 2009 8:18 pm
Reply with quote

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
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Thu Oct 08, 2009 8:40 pm
Reply with quote

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... icon_razz.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Finding faulty logic Subscript out of... COBOL Programming 5
This topic is locked: you cannot edit posts or make replies. Need assistance in job scheduling logic. Mainframe Interview Questions 2
No new posts Rexx Logic error while adding seperat... CLIST & REXX 3
No new posts PL/1 Callback address logic in z/OS C... PL/I & Assembler 1
No new posts Sync logic between VSAM files and DB2... COBOL Programming 9
Search our Forums:

Back to Top