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

Reading HEX Value


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 96
Location: Delhi

PostPosted: Wed Feb 22, 2012 3:04 pm
Reply with quote

I have file where data is in format as below.


Code:
<T074               
4EFFF4444056642144444
C30740000394800C00000


In this there is a number 359646840201

How can I read this number form the above line in REXX.

And for this field PICTURE Clause is S9(12)


Can someone help..
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Feb 22, 2012 3:08 pm
Reply with quote

search the forum ( my posts ) for rexx pack unpack
ok I had it bookmarked

here
ibmmainframes.com/viewtopic.php?t=27921&highlight=rexx+pack+unpack
and here
ibmmainframes.com/viewtopic.php?t=41407&highlight=rexx+pack+unpack
and here
ibmmainframes.com/viewtopic.php?t=31547&postdays=0&postorder=asc&start=15
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 96
Location: Delhi

PostPosted: Wed Feb 22, 2012 3:18 pm
Reply with quote

Hi,

I read the posts, but I dont think I need it in such a details. I just want to know if I can put my number in hex format to search it.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Feb 22, 2012 3:20 pm
Reply with quote

that is not what the topic title said
Quote:
Reading HEX Value

and what You asked
Quote:
How can I read this number form the above line in REXX.

icon_evil.gif
anyway the answer is YES
Back to top
View user's profile Send private message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 96
Location: Delhi

PostPosted: Wed Feb 22, 2012 3:31 pm
Reply with quote

Yaa, Sorry for confusing you with my question.

Can you tell how to read this number in hex format.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Feb 22, 2012 3:33 pm
Reply with quote

Bear in mind that you are showing a "packed decimal" number, positively signed. So you have a "C" at the end of the number, using half a byte, so you'll have to deal with it, and any "D" which would show a negative value for the number.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Feb 22, 2012 4:24 pm
Reply with quote

scorp_rahul23
do you realize that you are looking at a 7 byte field?

the number that you have provided as an example: 359646840201

would be x'0359646840201C'

the reason Enrico provided the links is that
the details from which you wish to absquatulate without any knowledge
would free you from future rookie questions.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Wed Feb 22, 2012 5:02 pm
Reply with quote

dbzTHEdinosauer wrote:
scorp_rahul23
do you realize that you are looking at a 7 byte field?

the number that you have provided as an example: 359646840201

would be x'0359646840201C'

Actually, his OP offers an embarrassing mishmash of packed decimal, binary, and zoned decimal (heesh may be too stupid or lazy to use an explicit USAGE clause on his COBOL picture, but the assumption of the compiler would be USAGE IS DISPLAY). Moreover, despite nearly four years of membership, heesh still refuses to use code tags or read documentation.

I recommend that we prescind from this topic until the TS starts acting like a human being instead of like a software engineer.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Feb 22, 2012 5:29 pm
Reply with quote

Akatsukami

you have again caught me assuming.

good post
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Feb 22, 2012 7:31 pm
Reply with quote

Quote:
Can you tell how to read this number in hex format.


whatever You mean by <read> the code snippets pointed by the links
provide the tested code to transform a packed number into a displayable thing and viceversa

if Yo are not able to understand that, then a career switch is strongly advised icon_evil.gif
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts Rexx program reading a DSN then write... CLIST & REXX 4
No new posts Reading subsequent rows in a query. DB2 12
No new posts COBOL reading from SYSIN COBOL Programming 1
Search our Forums:

Back to Top