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

Elimating Low values in REXX


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

New User


Joined: 19 May 2010
Posts: 3
Location: India, mumbai

PostPosted: Mon Mar 26, 2012 9:24 am
Reply with quote

Hi,


Anyone know how to eliminate low values or to identify low-values in a variable in REXX.

I am populating a field from a table the table is returning low values.I want to replace the low values by spaces or zeroes.

Thanks in advance.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Mar 26, 2012 12:34 pm
Reply with quote

use index or pos to find the position of the first x'00' (I presume that that is what you mean by low values) and use that to provide overlay or substr with the information to put in a space.
Back to top
View user's profile Send private message
Stefan

Active User


Joined: 12 Jan 2006
Posts: 110
Location: Germany

PostPosted: Mon Mar 26, 2012 12:51 pm
Reply with quote

The TRANSLATE function does what its name already implies.
Example:
Code:
new_string = translate(string,'F0'x,'00'x)
Copy the content of variable <string> to variable <new_string> and replace all low values (hex 00) by the character 0 (hex F0).
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: Mon Mar 26, 2012 2:07 pm
Reply with quote

divakaran wrote:
[...]

I am populating a field from a table the table is returning low values.I want to replace the low values by spaces or zeroes.

[...]


If you're getting data from a table, why do you suddenly feel the need to change it?

Or, perhaps more likely, why don't you change your program to only access valid entries in the table?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Mar 26, 2012 3:57 pm
Reply with quote

changing the data in your rexx is the ass backwards way to do it.

when you say table, is it a db2 table or an ispf table?

if db2, what is the datatype of the column?
if char, use the REPLACE function in your SQL.
if not char, what then?

if it is an ispf table, the place to change it is when the ispf table is created.
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 Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
Search our Forums:

Back to Top