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

getting abend 4038


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sweta.ssm

New User


Joined: 28 Feb 2010
Posts: 3
Location: India

PostPosted: Mon Mar 22, 2010 12:10 am
Reply with quote

Hi All,

I have a DB2 table for storing a 10 digit numeric data.. I have defined the datatype as DECIMAL(10,0) and the PIC clause is s9(10)V COMP-3. Am fetching the value from SELECT statement, using the value in my program and again incrementing the value by 1 and updating the same table with the incremented value. When I do this, am getting abend 4038. I see in CEDF that SQLCODE for select is zero and soon after executing this command, am getting abend.

If I delete the row in the table and leave the table with no rows at all, then am not getting any abend since SQLCODE is 100 for both select and update.

Not sure what exactly is causing abend 4038. Appreciate any suggestions.
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: Mon Mar 22, 2010 12:27 am
Reply with quote

A 4038 abend is an LE abend code indicating that there is an unhandled error in the program. In other words, the 4038 just says something else didn't work -- you need to find out what and fix it. You may need to talk to your site support group for assistance.
Back to top
View user's profile Send private message
sweta.ssm

New User


Joined: 28 Feb 2010
Posts: 3
Location: India

PostPosted: Mon Mar 22, 2010 1:19 am
Reply with quote

Thanks for the reply..
I found that error is in MOVE statements where am trying to move between COMP-3 and numeric items...

01 WS-PR-COMP PIC S9(13)V COMP-3.
01 WS-PR REDEFINES WS-PR-COMP.
05 WS-DATA PIC --9.
05 WS-R-NUM PIC ---------9.


MOVE WS-COMMAREA-DATA TO WS-DATA
MOVE H-RN (from DB2 table which is comp-3) TO WS-R-NUM
MOVE WS-PR-COMP TO H-COM-VAR

The problem is with the last MOVE statement. I have SQLCODE -310 when I used H-COM-VAR (which is host variable defined as COMP-3 in the table) to insert into a table..

Cant we move NUMERIC DATA to COMP-3?
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: Mon Mar 22, 2010 1:46 am
Reply with quote

You can move numeric data to a COMP-3 field -- since both are numeric. However, your redefine on the COMP-3 field shows a complete lack of understanding of the format COBOL uses to store COMP-3 variables internally. I strongly recommend you click on the manuals link at the top of the page, find the COBOL manuals, and read up on internal formats until you see why what you've done is completely wrong. Hint: your two 05 level variables are both USAGE DISPLAY which are redefined on a USAGE COMP-3 variable.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Mar 22, 2010 2:34 am
Reply with quote

Hello,

With a redefinition like the one posted, what could it do if it did work?

After reading about how numerics are stored/used, you may want to diagram what is you are actrying to accomplish. Suggest also you speak with some senior or your team leader so they can explain what you have as data and what must be done with this data.

No only can the system not do what has been coded, it is not at all clear why this would be required icon_confused.gif
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Mon Mar 22, 2010 11:04 am
Reply with quote

Haven't you got a message at compile about the redefine field larger than the original field ?
Because it's a warning, can you ignore such message ??? NO!

WS-PR-COMP is 7 bytes long, WS-PR is 13 bytes, this should have ring a bell!

Remove the COMP-3 and replace the '-'s by '9's, maybe it will do what you want.
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 ISAM and abend S03B JCL & VSAM 10
No new posts Abend S0C4 11 (Page Translation Excep... PL/I & Assembler 16
No new posts WER999A - UNSUCCESSFUL SORT 8ED U Ab... SYNCSORT 5
No new posts the system or user abend SF0F R=NULL COBOL Programming 0
No new posts Need to get an DLI abend like U0200 IMS DB/DC 2
Search our Forums:

Back to Top