Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

storing an integer as a hex decimally 4-byte string

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Jul 23, 2007 5:28 pm    Post subject:
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    Post subject:
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    Post subject: Re: storing an integer as a hex decimally 4-byte string
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: 3158
Location: Tucson AZ

PostPosted: Tue Jul 24, 2007 1:23 pm    Post subject:
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    Post subject: Integer to hex conversion
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts 2 byte YEAR from Y'DATE2' field tecnokrat DFSORT/ICETOOL 2 Tue Feb 07, 2017 12:05 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us