GETMAIN RESP



Support for CICS/ESA, CICS/TS & Transaction Gateway, CICS Configuration Manager and CICS Performance Analyzer

GETMAIN RESP

Postby elixir » Fri Jul 13, 2012 9:45 am

Hi

I using GETMAIN to obtain memory for my Linkage section in Cobol CICS Program. Im checking response as below,

EXEC CICS
GETMAIN ..
RESP(WS-ROSP)
END-EXEC

IF WS-ROSP not equal to DFHRESP(NORMAL)

MOVE EIBRESP to WS-1 (--This X(02))
MOVE EIBRESP to WS-2 (--This X(03))

RETURN to CICS

END-IF

Im am trying to display the error code on Screen using WS-1 and WS-2.

The error code isnot getting displayed properly. Im aware that the EIRESP and EIBRESP2 are 4 bytes Comp --> S9(08) COMP.

Please help me display the error code correctly. For eg if there is LENGTHERR the I should get EIBRESP 22. (please correct me if Im wrong with the error code interpretation)
elixir
 
Posts: 3
Joined: Tue Jul 28, 2009 3:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: GETMAIN RESP

Postby NicC » Fri Jul 13, 2012 10:30 am

s9(8) is 8 digits so why are you only providing space for 2 and 3 digits? And what do you mean by 'not getting displayed properly'? Are you getting them upside down, back to front or what?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: GETMAIN RESP

Postby Monitor » Fri Jul 13, 2012 11:22 am

Normally there is no need to check the numeric value of the resp-field. Thats why you have the ability to check ii via DFHRESP(resp-name). The translator will do the job for you.
If you run EDF, you will see the resp returned from your EXEC-command.
Monitor
 
Posts: 98
Joined: Wed Jan 18, 2012 8:59 pm
Has thanked: 0 time
Been thanked: 7 times

Re: GETMAIN RESP

Postby Robert Sample » Fri Jul 13, 2012 4:51 pm

You need to find the COBOL Language Reference manual and read up on internal formats for data. The actual value of an EIBRESP 22 code as stored in COBOL is X'00000016' which is the binary value 22. Moving this value to a PIC X(2) variable will give you X'0000' since alphanumeric data is moved left to right (as opposed to numeric moves, which is decimal-adjusted before moving). Even if you did the move correctly, your PIC X(2) variable would have the value X'0016' in it -- not conducive to being displayed on a screen.

If you want to display the numeric EIBRESP value (which is quite likely the WORST single way to handle the abnormal response code -- learn to use the DFH values), you'll need a PIC 9(3) variable defined on your screen so the data can be moved as a number.

These users thanked the author Robert Sample for the post:
sinmani (Fri Jul 27, 2012 12:44 pm)
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: GETMAIN RESP

Postby elixir » Fri Jul 13, 2012 9:04 pm

The WS-ROSP contains always EIBRESP?

I went thru the manual but not able to understand the significance of EIBRESP2
elixir
 
Posts: 3
Joined: Tue Jul 28, 2009 3:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: GETMAIN RESP

Postby Monitor » Fri Jul 13, 2012 9:30 pm

In your case WS-ROSP containt th value from EIBRESP. Thats what you have told the translator to do, when you coded RESP(WS-ROSP). Have a look at the translator listing.
I had a short look at the manual and found the following:
EIBRESP2
contains more detailed information that may help explain why the RESP condition occurred. This field contains meaningful values, as documented with each command to which it applies.

Do you hav a problem understanding that?
I also had a look at the GETMAIN command and found the information here:
http://publib.boulder.ibm.com/infocente ... fields.htm

There are only two (2) conditions returned, apart from NORMAL, from this command.
LENGERR
RESP2 values:
1
The FLENGTH value is less than 1 or greater than the length of the target storage area from which the request is to be satisfied. See the discussion about DSAs in CICS storage allocation.

Also occurs if the LENGTH value is zero.

Default action: terminate the task abnormally.
NOSTG
RESP2 values:
2
The storage requested is more than is currently available in the target DSA. See the discussion about DSAs in CICS storage allocation.

Default action: ignore the condition. An active HANDLE CONDITION NOSTG also raises this condition.


If you have a problem with your program, just use CEDF and you will se the information you are after.
If you GETMAIN doesnt return a NORMAL condition, you shouldnt handle this in your program.
Default action is to ABEND the task.
Monitor
 
Posts: 98
Joined: Wed Jan 18, 2012 8:59 pm
Has thanked: 0 time
Been thanked: 7 times

Re: GETMAIN RESP

Postby elixir » Mon Jul 16, 2012 8:50 pm

The way I handled is as below,
Declared 2 WS storage variable, var1 pic 9(04) var2 pic9(04)

EXEC CICS
GETMAIN ..
RESP(WS-ROSP)
END-EXEC

IF WS-ROSP not equal to DFHRESP(NORMAL)

MOVE EIBRESP to var1
MOVE EIBRESP to var2

RETURN to CICS

END-IF

Im able to display in the screen the response code in case of GETMAIN failure

Also in my case WS-ROSP always contains EIBRESP.

Thanks to all for the help
elixir
 
Posts: 3
Joined: Tue Jul 28, 2009 3:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: GETMAIN RESP

Postby Robert Sample » Mon Jul 16, 2012 11:31 pm

Make sure your VAR1 has at least 3 characters to display the response code since they can have values over 100 nowadays.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to CICS

 


  • Related topics
    Replies
    Views
    Last post