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

Confusion regarding length of SQLCA variable


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Vivek0410

New User


Joined: 24 Mar 2018
Posts: 2
Location: India

PostPosted: Thu Oct 18, 2018 2:20 pm
Reply with quote

I was doing random search on SQLCA and I noticed that most of the articles refer to Length of SQLCA as Maximum Length of SQLCA.

So does the length vary and is not always 136 ? I am not sure how this is the case as SQLCA is just another variable.

And if the length is fixed (136), then what would be the significance of SQLCABC variable ?
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Sat Oct 20, 2018 1:58 am
Reply with quote

If you carefully observe SQLCA copybook and sum it then it is 136. and if you have any doubt then force abend the program by displaying SQLCA and check each variable and sum up too there to double check it matches 136 and it does.
Back to top
View user's profile Send private message
Vivek0410

New User


Joined: 24 Mar 2018
Posts: 2
Location: India

PostPosted: Mon Oct 22, 2018 12:36 pm
Reply with quote

Thanks Rohit. Actually I knew the length of SQLCA is 136.

What I am unsure of is why on internet (Most of the technical forums), it is referred to as "Maximum Length of SQLCA".

Also, what is the significance of SQLCABC, which contains the length of SQLCA, if it is known that it is of 136 bytes.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Oct 22, 2018 1:00 pm
Reply with quote

Quote:
Also, what is the significance of SQLCABC, which contains the length of SQLCA, if it is known that it is of 136 bytes.

One day it may change so avoid specifying the exact figure and make your code future-proof.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Tue Oct 23, 2018 11:15 pm
Reply with quote

Quote:
What I am unsure of is why on internet (Most of the technical forums), it is referred to as "Maximum Length of SQLCA".
Is it wrong to refer when it is right value?

Quote:
Also, what is the significance of SQLCABC, which contains the length of SQLCA, if it is known that it is of 136 bytes.
In case if we pass the SQLCA back to calling or called application then to check them the length of SQLCA =136 easier than calculating it again and there could be many more cases where it is required. I have personally never used it but many might have used it in past.
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts FILE STATUS - 39 ON VARIABLE LENGTH V... COBOL Programming 2
No new posts BMS map length field greater than zero CICS 3
No new posts Unable to display comp variable COBOL Programming 4
No new posts IWS/TWS build dinamic or variable APp... IBM Tools 0
No new posts Determine what library member is in, ... JCL & VSAM 9
Search our Forums:

Back to Top