Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Declaration & Initialization of HEX in PL/1

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & ASSEMBLER
Author Message
Ashokn

New User


Joined: 25 Jun 2008
Posts: 13
Location: Bangalooru

PostPosted: Thu Jun 26, 2008 2:24 pm    Post subject: Declaration & Initialization of HEX in PL/1
Reply with quote

Hi,

How to declare & initialize a hexadecimal value in pl/1?

For example: In some language:-
DEFINE ERRHEX 5 H VALUE ='1002' ;

what will be the equivalent of above statement in PL/1?

Thanks in adv...
Back to top
View user's profile Send private message
References
PostPosted: Thu Jun 26, 2008 2:24 pm    Post subject: Re: Declaration & Initialization of HEX in PL/1 Reply with quote

Garry Carroll

Active User


Joined: 08 May 2006
Posts: 134
Location: Dublin, Ireland

PostPosted: Thu Jun 26, 2008 3:02 pm    Post subject:
Reply with quote

You can code:

Code:
 DCL    HEX_FIELD    CHAR(1) INIT('05'X);


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

Global Moderator


Joined: 23 Nov 2006
Posts: 8036
Location: 221 B Baker St

PostPosted: Thu Jun 26, 2008 8:19 pm    Post subject:
Reply with quote

Hello,

I'm may be misunderstanding something, but how might "VALUE ='1002'" = "INIT('05'X)"?
Back to top
View user's profile Send private message
Garry Carroll

Active User


Joined: 08 May 2006
Posts: 134
Location: Dublin, Ireland

PostPosted: Thu Jun 26, 2008 8:33 pm    Post subject:
Reply with quote

Sorry,

Read the 5 in the post incorrectly.

Code:
DCL  HEX_FIELD  CHAR(2) INIT('1002'X);

or, for array,
Code:
DCL HEX_FIELD(5) CHAR(2) INIT((5)'1002'X);

 

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

Global Moderator


Joined: 23 Nov 2006
Posts: 8036
Location: 221 B Baker St

PostPosted: Thu Jun 26, 2008 8:51 pm    Post subject: Reply to: Declaration & Initialization of HEX in PL/1
Reply with quote

Quote:
Sorry,
Not a problem icon_smile.gif

Just checking to see what i might have missed. . .

Thanx for the clarification icon_wink.gif

d
Back to top
View user's profile Send private message
Ashokn

New User


Joined: 25 Jun 2008
Posts: 13
Location: Bangalooru

PostPosted: Fri Jun 27, 2008 9:40 am    Post subject: Declaration & Initialization of HEX in PL/1
Reply with quote

Thanks for your answers.It cleard my long awaiting doubt .
==============================================
Garry Carroll wrote:
Sorry,

Read the 5 in the post incorrectly.

Code:
DCL  HEX_FIELD  CHAR(2) INIT('1002'X);

or, for array,
Code:
DCL HEX_FIELD(5) CHAR(2) INIT((5)'1002'X);

 

Garry.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & ASSEMBLER All times are GMT + 6 Hours
Page 1 of 1