MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

which is equal to X'00000000000000000000000000000C' ?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
culturewyj
Beginner


Joined: 15 Jun 2006
Posts: 15
Topics: 10

PostPosted: Fri Mar 02, 2007 3:56 am    Post subject: which is equal to X'00000000000000000000000000000C' ? Reply with quote

03 CN-PACK0 PIC X(15) VALUE
X'00000000000000000000000000000C'.
which is equal to X'00000000000000000000000000000C' ?
thanks for any suggestions
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Fri Mar 02, 2007 4:19 am    Post subject: Reply with quote

x'00000000000000000000000000000C' is equal to it.

What do you mean?
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Fri Mar 02, 2007 6:00 am    Post subject: Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Fri Mar 02, 2007 6:30 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Mar 02, 2007 6:31 am    Post subject: Reply with quote

culturewyj,

The variable will have Packed Decimal(comp-3) value of 0 (zero).

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Crox
Beginner


Joined: 29 May 2004
Posts: 52
Topics: 9

PostPosted: Sat Mar 17, 2007 3:22 am    Post subject: Reply with quote

another way to code the same value:

03 CN-PACK0.
05 PIC S9(15) PACKED-DECIMAL VALUE ZERO.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group