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
 

 

Reading comp-3 field in REXX using DISKR

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
avaneendra_linga

New User


Joined: 13 Dec 2006
Posts: 73
Location: Hyderabad

PostPosted: Thu Jan 18, 2007 2:26 pm    Post subject: Reading comp-3 field in REXX using DISKR
Reply with quote

hi,

i need to prepare a report from a input PS file. In the input PS file layout some field values are in COMP-3 format.Due to this when i read this file in REXX using DISKR i am getting JUNK values which are coming as ??? and some junck sybols.....

IS THERE ANYWAY IN REXX TO GET PROPERVALUES FOR THIS FIELDS?

IF CAN YOU PLEASE PROVIDE EXAMPLE SYNTAX?
Back to top
View user's profile Send private message

acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Thu Jan 18, 2007 3:46 pm    Post subject:
Reply with quote

search for C2X
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Thu Jan 18, 2007 3:53 pm    Post subject:
Reply with quote

acevedo wrote:
search for C2X
And then chop off the last byte?
Back to top
View user's profile Send private message
avaneendra_linga

New User


Joined: 13 Dec 2006
Posts: 73
Location: Hyderabad

PostPosted: Thu Jan 18, 2007 4:01 pm    Post subject:
Reply with quote

hi,

my input filed value is date value stored in comp-3 format.
i need to convert that into displayable variable in REXX...
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Thu Jan 18, 2007 4:05 pm    Post subject:
Reply with quote

Did you
acevedo wrote:
search for C2X
?
It looks like it will work for you:
Quote:
C2X('0123'X) -> '0123' /* 'F0F1F2F3'X in EBCDIC */
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Jan 18, 2007 5:44 pm    Post subject: Re: Reading comp-3 field
Reply with quote

REXX Packed-to-Decimal Function:

Code:

/* REXX P2D */
Parse Arg number_p
erg = C2X(number_p)
sign = Right(erg,1)
number = Left(erg,Length(erg)-1)
If sign = 'D' Then
  Return '-'||number
Else
  Return number
Back to top
View user's profile Send private message
avaneendra_linga

New User


Joined: 13 Dec 2006
Posts: 73
Location: Hyderabad

PostPosted: Fri Jan 19, 2007 10:38 am    Post subject: HI
Reply with quote

hi,

IT'S WORKING FINE..THANKS A LOT TO EVERBODY FOR IMMEDIATE RESPONCES......

CAN ANYBODY HELP IN PROVIDING THE MANUAL FOR THIS TYPE OF COMMANDS (c2x) FOR FUTURE REFERENCE.......
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Fri Jan 19, 2007 12:54 pm    Post subject:
Reply with quote

C2X is one of REXX's built-in functions, and they are documented here.

O.
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts Running an REXX EXEC implicitly sho7hills CLIST & REXX 3 Thu Apr 20, 2017 8:14 am
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm


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