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
 

 

SQLCODE FFFFFC66 what is this error ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Wed Jan 07, 2009 7:20 pm    Post subject: SQLCODE FFFFFC66 what is this error ?
Reply with quote

HI,

I have SQLCODE FFFFFC66. How to convert it to readable SQLCODE. This error occurred when executing a cobol program which uses CICS.

Thank You In Advance,
Sushanth Bobby
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7914
Location: Bellevue, IA

PostPosted: Wed Jan 07, 2009 7:43 pm    Post subject:
Reply with quote

Windows has a calculator function that converts hex to decimal. There are also other ways to convert the value both on the web and on mainframes. FC66 is -922 decimal.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Wed Jan 07, 2009 7:51 pm    Post subject:
Reply with quote

Robert,

In windows i have tried the CALCULATOR application for FC66, its giving 64614. I also tried in the EXCEL using =HEX2DEC("FC66"). Same result 64614.

Can you give me tip to how to convert in any one of the applications in windows or mainframe.

Sushanth Bobby
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Jan 07, 2009 7:57 pm    Post subject: Reply to: SQLCODE FFFFFC66 what is this error ?
Reply with quote

negative numbers in binary are in two complement notation

FFFFFC66 ==> -39A ==> -922
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7914
Location: Bellevue, IA

PostPosted: Wed Jan 07, 2009 8:01 pm    Post subject:
Reply with quote

Windows calculator, scientific mode, hex, key or click in FC66. Hit the +/- key to negate the value and note the 039A. Clear, enter 39A and hit the decimal key. See the value 922 on the display. Hit the +/- key again to reverse the sign to its original value.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Wed Jan 07, 2009 8:38 pm    Post subject:
Reply with quote

Thank You Enrico,
Thank You Robert,

Sushanth Bobby
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Wed Jan 07, 2009 9:04 pm    Post subject:
Reply with quote

or subtract 64K (65536) from 64614 to get -922.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Wed Jan 07, 2009 9:10 pm    Post subject:
Reply with quote

or have DB2 translate the error for you by calling DSNTIAC (DSNTIAR for batch) for a formatted version of the SQLCODE.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Thu Jan 08, 2009 9:55 am    Post subject:
Reply with quote

Thank You Terry,

Quote:
subtract 64K (65536) from 64614 to get -922.


I have one doubt, for any type of SQLCODE error will it be 64K only. What is the reason behind 64K, that is WHY 64K ?

Sushanth
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Thu Jan 08, 2009 10:31 am    Post subject:
Reply with quote

Hello,

The decimal value of x'FFFF' is 65535. When 1 is added, it gives 65536 - which is 64k. This is the largest number that will fit in 2 bytes.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Thu Jan 08, 2009 10:38 am    Post subject:
Reply with quote

Someone with a math background can probably explain it better than me, but I once noticed that if you increment 32,767 (the largest positive number that fits in a 2-byte binary field) by one you get X'8000' which is -0. Increment by one again and you get -1. Again, you get -2. In other words every increment by a +1 results in a successively smaller number. The same thing happens with 64K. Once you reach the maximum positive number, adding +1 to it results in successively smaller numbers. I guess this is because the sign of a binary number is stored in the leftmost bit. As I said, someone with a math background could I'm sure explain it better. icon_smile.gif
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Thu Jan 08, 2009 11:05 am    Post subject:
Reply with quote

D.sh & Terry,


I just want to check is my calculation correct.
SQLCODE : FFFFFC66
splitting the SQLCODE in 2 parts,
first part : FFFF
FFFF+1 = 65536
second part : FC66
FC66 = 64614

Subracting the decimals of Part2 from Part 1,
922

And the -ve sign is got by,
Quote:
Once you reach the maximum positive number, adding +1 to it results in successively smaller numbers


Final Result Code = -922


Sushanth
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Thu Jan 08, 2009 8:54 pm    Post subject: Reply to: SQLCODE FFFFFC66 what is this error ?
Reply with quote

I don't fully understand 2s compliment but if you flip all the bits of X'FC66' which is 1111 1100 0110 0110 you get 0000 0011 1001 1001 which is X'0399'. Adding 1 you get X'039A' which is decimal 922. Reversing the sign, it becomes -922. A quicker way to get to the final result is to simply subtract 64K from the SQLCODE as shown by SQLCA. I don't know if that's more confusing or not. icon_smile.gif
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1219
Location: Israel

PostPosted: Thu Jan 08, 2009 10:23 pm    Post subject:
Reply with quote

sushanth bobby wrote:
I just want to check is my calculation correct.
SQLCODE : FFFFFC66
splitting the SQLCODE in 2 parts,
first part : FFFF
FFFF+1 = 65536
second part : FC66
FC66 = 64614

Subracting the decimals of Part2 from Part 1,
922

Sushanth

No splitting of SQLCODE!!!

If you really want, you can do the full calculation (all numbers in hexa): 100000000 - FFFFFC66 = 39A

But it's easier to use smaller numbers, they give the same result:
(100000000 - FFFFFC66) = (1000000 - FFFC66) = (10000 - FC66)

Isn't that magic ??? icon_smile.gif
Back to top
View user's profile Send private message
surya.kalyan

New User


Joined: 09 Jan 2007
Posts: 20
Location: Mumbai

PostPosted: Thu Jan 15, 2009 8:55 pm    Post subject: Reply to: SQLCODE FFFFFC66 what is this error ?
Reply with quote

A simple way:
1) Use the windows scientific calculator...
2) select hex in the radio button....
3) select Dword radio button (4 bytes)...
4) paste your number FFFFFC66...
5) press the button +/-....
6) press =....
7) I got 39A...
8) select the dec radio button now...
9) the decimal number 922...


One more way using the calculator is:
Repeat the procedure till 4 in the steps above...
after pasting FFFFFC66
5) press NOT button...
6) add 1....
7) I got 39A...
8) select the dec radio button now...
9) the decimal number 922...

So, the number was -922

In short: The negative of a number is stored as Two's complement which is inverting the bits from zero to 1 (1's complement and then adding 1).
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm
No new posts Error during restore rename archanamuthukrishnan All Other Mainframe Topics 2 Fri Oct 14, 2016 3:30 pm
No new posts Error IEC161I 052(009,XXXRS00)-084 wh... amitc23 JCL & VSAM 10 Wed Oct 12, 2016 5:00 pm
No new posts IDMS/DC-COBOL program - SNAP error wh... rakeshsekar1987 IDMS/ADSO 5 Tue Sep 13, 2016 8:28 pm


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