View previous topic :: View next topic
|
Author |
Message |
dilpreet
New User
Joined: 18 Mar 2008 Posts: 34 Location: INDIA
|
|
|
|
what will be displayed if
variable X initialized to spaces
compute X = X+1
Display X |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
I'd guess that if X had an unsigned pic of numeric display, "1" would be the answer.
If it were signed, I'd think that you'd get a data exception.
Just a guess...... |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Why dont you try it?
Expain what is your "display problem" .
Do not ask output of your code to people... |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
What result do you get? Does it depend on the definition of X? |
|
Back to top |
|
|
dilpreet
New User
Joined: 18 Mar 2008 Posts: 34 Location: INDIA
|
|
|
|
Just wanted to know that what wud be displayed if such condition happens
Will it abend or display 1 |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Good guessing, CICS Guy, I'm with you on that ... COMP data field value would depend on half word, whole word, double word. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
dilpreet: your problem is poorly stated. X can be signed or unsigned, USAGE DISPLAY, USAGE COMP, USAGE COMP-3, or even COMP-1 / COMP-2. Results, as we've clearly indicated, will vary depending on which way(s) X is defined. 1 is a possible answer. 16449 is a possible answer. S0C7 abend is a possible answer. 1077952577 is a possible answer. There are others possible. State your problem better, get better answers. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Unless the compiler issues an OI X'0F' against the SPACE after it's been packed, the sign-bit will be invalid (B'0100') and the subsequent AP instruction will fail with a S0C7.
Just my .02 cents....
Regards, |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Bill O'Boyle wrote: |
Unless the compiler issues an OI X'0F' against the SPACE after it's been packed, the sign-bit will be invalid (B'0100') and the subsequent AP instruction will fail with a S0C7. |
Exactly what I was thinking..... |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Bill, if the field is packed or signed USAGE DISPLAY yes you get a S0C7 abend. If, however, the field is unsigned USAGE DISPLAY the result is a 1. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Robert Sample wrote: |
Bill, if the field is packed or signed USAGE DISPLAY yes you get a S0C7 abend. If, however, the field is unsigned USAGE DISPLAY the result is a 1. |
Exactly what I was thinking..... , thanks for the update...
Bill, just the CICS Guy...... |
|
Back to top |
|
|
|