Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Elimating Low values in REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Elimating Low values in REXX
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: 1894
Location: UK

PostPosted: Mon Mar 26, 2012 12:34 pm    Post subject:
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    Post subject: Re: Elimating Low values in REXX
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Mar 26, 2012 2:07 pm    Post subject: Re: Elimating Low values in REXX
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: 6968
Location: porcelain throne

PostPosted: Mon Mar 26, 2012 3:57 pm    Post subject:
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    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
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 47 Fri Sep 29, 2017 1:08 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us