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

How to convert RESP code 12 to text?


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gregory oakes

New User


Joined: 21 Jan 2021
Posts: 8
Location: Canada

PostPosted: Mon Feb 08, 2021 4:32 am
Reply with quote

CICS COBOL Program tries to read a VSAM file and since the file is not setup correctly the program reports this error:

Transaction I001 failed with abend ????

After some small changes, I got the following error that is a bit more helpful:

Transaction I001 failed with abend AEIL

I looked up AEIL and
the explanation is 'FILENOTFOUND condition not handled'.

I know that when the file is present, and setup correctly in CICS, then I don't get this error.

After some checking I figured out that AEIL - FILENOTFOUND is RESP code 12.

Is there a method in CICS programming to convert things like EIBRESP=12 to 'FILENOTFOUND' without having to custom code the translation of 12 to appropriate text?

I have the same question for other fields in the Exec Interface Block (EIB): EIBFN, EIBRCODE, EIBRESP2.

I have spent much time searching online, and browsing through the CICS manuals, and have not come across a solution. In fact, the only reference I found was mentions about 'EIBFN_NAME' in discussions about EIBFN, but there was no mention of where this NAME field is, or how to access it. I suspected there must be a method or function or utility or something else that might do the conversion from a code to a literal for the code. Still no luck finding it.

My guess is that if it exists then it is under a name or acronym that I have not thought of so far.

Thanks,
Greg
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Mon Feb 08, 2021 10:53 am
Reply with quote

You can create your own copybook and use that for custom translations to any text you want based on the error codes.
Back to top
View user's profile Send private message
gregory oakes

New User


Joined: 21 Jan 2021
Posts: 8
Location: Canada

PostPosted: Mon Feb 08, 2021 7:51 pm
Reply with quote

Are you saying that there is no generic method or utility to convert codes to text in this case, and that custom code is the only way to do this?

I was hoping that with all the tables in the documentation that show the codes and corresponding text, that there was some generic method or utility for this versus custom code.

Custom coding always is risky due to normal evolution of the platform. Any changes to codes, or addition of codes would then be always missing from the custom coding, and could cause problems in the future.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1314
Location: Vilnius, Lithuania

PostPosted: Mon Feb 08, 2021 9:12 pm
Reply with quote

Automate the creation of the copybook.

I have an edit macro that decodes error messages from the z/OS XML parser. It accepts, be it with just a bit of manual massaging, the Cut & Paste'd section of the IBM PDF and spits out the message-text when given the returncode. I'm sure it wouldn't be much harder to do something similar for CICS messages, and it would just be included in the script executed upon the upgrade to a new version of CICS.
Back to top
View user's profile Send private message
gregory oakes

New User


Joined: 21 Jan 2021
Posts: 8
Location: Canada

PostPosted: Mon Feb 08, 2021 9:16 pm
Reply with quote

Interesting idea Robert, but it sounds like there is no generic method or utility to convert codes to text in this case, and that custom code is the only way to do this. Is that correct?
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1314
Location: Vilnius, Lithuania

PostPosted: Mon Feb 08, 2021 10:22 pm
Reply with quote

And you can always file an RFE suggesting that IBM creates a member in (one of) the CICS samplib(s) containing the messages.

In a grey(ish) past (2015) I've suggested that IBM adds similar members to the Enterprise PL/I samplib with the compiler options and those of still, in-service, older versions so that users can compare changes and update their site-set-up. It was accepted. This would be just as useful.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Tue Feb 09, 2021 1:11 am
Reply with quote

gregory oakes wrote:
Are you saying that there is no generic method or utility to convert codes to text in this case, and that custom code is the only way to do this?

I was hoping that with all the tables in the documentation that show the codes and corresponding text, that there was some generic method or utility for this versus custom code.

Custom coding always is risky due to normal evolution of the platform. Any changes to codes, or addition of codes would then be always missing from the custom coding, and could cause problems in the future.

1. I missed to understand why do you need to translate it ?
2. IBM Manual has the Code Vs Text mapping already and you can always refer that when you know the error code.
3. If you still require to translate it then I don't remember of anything CICS provides by it own other than customizing the creation of copybook.

EXEC interface block fields
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Tue Feb 09, 2021 1:43 am
Reply with quote

Quote:
Any changes to codes, or addition of codes would then be always missing from the custom coding, and could cause problems in the future.


unless the developers in Your organisation are plain morons
I do not see what kind of problems your organisation might face

changes in the RESP codes, certainly NOT
new codes probably yes , but I do not see the problem

as soon as a developer gets a numeric representation instead of the pseudo clear text

somebody will just have to add the entry

anyway the addition/changes in the return codes is ALWAYS Cleary documented in the migration guides
Back to top
View user's profile Send private message
gregory oakes

New User


Joined: 21 Jan 2021
Posts: 8
Location: Canada

PostPosted: Tue Feb 09, 2021 9:27 pm
Reply with quote

Hello,

My interest was in trying to make the error codes more meaningful by translating them to appropriate text. Having custom code to do this is one option, but having system method or utility or function to do this is always better.

I did some testing and it seems that the CICS default error handling does convert numeric codes to literals. In Test 1 example below, if the EXEC CICS READ does not have RESP or NOHANDLE clause then the default error handling is used. The abort shows code AEIL, which is translated from code 12 that means 'FILENOTFOUND'. This implies that CICS has routines that translate numeric codes into literals, but I have yet to find samples of this coding to see if I can utilize it versus writing custom code.

======================
Test 1 - CMF000 file does not exist
and no error handling logic

*
EXEC CICS
READ FILE ('CMF000')
INTO (CUSTOMER-MASTER-RECORD)
RIDFLD(CUSTNOI)
END-EXEC.
*

CICS sent this message:

DFHAC2206 15:46:01 CICSTS54 Transaction I000 failed with abend AEIL.

AEIL is FILENOTFOUND error

=====================

In Test 6 example below, it shows that using user defined error handling with RESP clause on EXEC READ, that the RESPONSE-CODE is a numeric 12.

Test 6 - use RESPONSE-CODE-X-5-8 for ABCODE in ABEND

In Working-Storage:
01 RESPONSE-CODE PIC S9(8) COMP.
01 RESPONSE-CODE-9 PIC 9(8).
01 RESPONSE-CODE-X REDEFINES
RESPONSE-CODE-9.
05 RESPONSE-CODE-X-1-4 PIC X(4).
05 RESPONSE-CODE-X-5-8 PIC X(4).

In Procedure Division:
*
EXEC CICS
READ FILE ('CMF000')
INTO (CUSTOMER-MASTER-RECORD)
RIDFLD(CUSTNOI)
RESP (RESPONSE-CODE)
END-EXEC.
*
MOVE RESPONSE-CODE TO RESPONSE-CODE-9.
IF RESPONSE-CODE = DFHRESP(NORMAL)
MOVE 'READ - NORMAL' TO MESSAGEO
ELSE
EXEC CICS
ABEND ABCODE (RESPONSE-CODE-X-5-8)
END-EXEC
END-IF.
*

CICS sent this message:

DFHAC2206 16:58:50 CICSTS54 Transaction I000 failed with abend 0012.

'0012' is from ABCODE on ABEND
=====================

I have written a copy library containing the table to convert EIBRESP number to a literal. See RESPT002.txt.
And suggested lines for Procedure Division that may need some customization for individual programs. See RESPH002.txt.
Back to top
View user's profile Send private message
gregory oakes

New User


Joined: 21 Jan 2021
Posts: 8
Location: Canada

PostPosted: Tue Feb 09, 2021 9:29 pm
Reply with quote

Missing attachments that were discard during previous post.
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Copy only TEXT or String from a record SYNCSORT 4
No new posts CONVERT a given date from UTC TO BST CICS 0
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 4
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
Search our Forums:

Back to Top