IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

storing an integer as a hex decimally 4-byte string


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kpriya6

New User


Joined: 20 Nov 2006
Posts: 13

PostPosted: Mon Jul 23, 2007 5:23 pm
Reply with quote

Hi,
I need to know the procedure for storing an integer as a hex decimally 4-byte string in the long character string.
Can anyone help me out.



Thanks in Advance
Priya
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jul 23, 2007 5:28 pm
Reply with quote

Priya,

You should know better than to start a new thread on the end of an old one......

As far as you question goes, can you give an example?
Back to top
View user's profile Send private message
kpriya6

New User


Joined: 20 Nov 2006
Posts: 13

PostPosted: Tue Jul 24, 2007 10:00 am
Reply with quote

Hi
I have an integer variable which has a declaration of
PIC S9(9) USAGE COMP . I need this variable to be stored as
hex decimally 4-byte string in the long character string .



Can you please help me out.


Thanks in Advance.
Priya.
Back to top
View user's profile Send private message
vijaybachu

New User


Joined: 23 Jul 2007
Posts: 2
Location: Bangalore

PostPosted: Tue Jul 24, 2007 11:57 am
Reply with quote

Priya,
Why dont you try using Redefine.

The technik of using based for Fixed dec and char can be successfully used in PL/I, same can be implemented using COBOL using REDEFINE.

Regards....Bachu
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Jul 24, 2007 1:23 pm
Reply with quote

Depending on the compiler options, it probably already is....
01 hex-string.
05 binary-string pic s9(9) comp-5.
Back to top
View user's profile Send private message
kpriya6

New User


Joined: 20 Nov 2006
Posts: 13

PostPosted: Wed Jul 25, 2007 11:32 am
Reply with quote

Hi,
I have an integer variable with picture clause of S9(9) comp.
I need this to be stored as a hex decimally 4-byte string in the long character string.

When i convert the integer into hexadecimal value i get 8 digits
for example
If the value of integer is 999999999
When i convert this to hexadecimal value i get 389AC9FF.
When i move this to variable of PIC X(4)
I get only 389A.
Only if use a variable of PIC X(8).I am getting the value 389AC9FF.

Can any one help me out .

Thanks in Advance
Priya
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts 10 byte RBA conversion DB2 2
Search our Forums:

Back to Top