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
 

 

how to implement this referecnce modification logic.pls help

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Purnendu.it

New User


Joined: 11 May 2007
Posts: 59
Location: chennai

PostPosted: Thu Oct 08, 2009 1:18 pm    Post subject: how to implement this referecnce modification logic.pls help
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    Post subject:
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: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Thu Oct 08, 2009 5:31 pm    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need help in building a logic Benchwarmer All Other Mainframe Topics 4 Wed Feb 22, 2017 2:49 am
No new posts Wildcard logic in COBOL dudenithy COBOL Programming 13 Thu Sep 01, 2016 7:36 pm
No new posts Sort Logic to extract data scorp_rahul23 DFSORT/ICETOOL 13 Tue Mar 01, 2016 1:22 am
No new posts Need a logic to validate the data in ... sandeep kumar302 COBOL Programming 17 Mon Feb 01, 2016 3:30 pm
No new posts Tricky sort logic required pgopi92 DFSORT/ICETOOL 3 Mon Jan 25, 2016 3:29 pm


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