View previous topic :: View next topic |
Author |
Message |
culturewyj Beginner
Joined: 15 Jun 2006 Posts: 15 Topics: 10
|
Posted: Fri Mar 02, 2007 3:56 am Post subject: which is equal to X'00000000000000000000000000000C' ? |
|
|
03 CN-PACK0 PIC X(15) VALUE
X'00000000000000000000000000000C'.
which is equal to X'00000000000000000000000000000C' ?
thanks for any suggestions |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Fri Mar 02, 2007 4:19 am Post subject: |
|
|
x'00000000000000000000000000000C' is equal to it.
What do you mean? _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Fri Mar 02, 2007 6:00 am Post subject: |
|
|
OK - to be a bit kinder...you have a COBOL (I assume) variable declaration here declaring a variable with an initial VALUE of x'...... Look in the manual for the various ways of representing data. Also, the variable name gives a clue. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Fri Mar 02, 2007 6:30 am Post subject: |
|
|
as nic said, RTFM.
Quote: | which is equal to X'00000000000000000000000000000C' ? |
the above is a HEX literal, whereas
Quote: | 03 CN-PACK0 PIC X(15) VALUE X'00000000000000000000000000000C'. |
is a COBOL alphanumeric field initialized with a HEX value.
so, if they were to be compared, they would be equal.
one is a initialized variable and the other is a literal, so they are not the same; although they contain the same value.
question is poorly worded. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Fri Mar 02, 2007 6:31 am Post subject: |
|
|
culturewyj,
The variable will have Packed Decimal(comp-3) value of 0 (zero).
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Crox Beginner
Joined: 29 May 2004 Posts: 52 Topics: 9
|
Posted: Sat Mar 17, 2007 3:22 am Post subject: |
|
|
another way to code the same value:
03 CN-PACK0.
05 PIC S9(15) PACKED-DECIMAL VALUE ZERO. |
|
Back to top |
|
 |
|
|