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
 

 

Convert String value to Numeric Value

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

New User


Joined: 27 Mar 2006
Posts: 95
Location: India

PostPosted: Wed Jun 21, 2006 11:55 am    Post subject: Convert String value to Numeric Value
Reply with quote

Can any one help me for the following question.

I want to remove the character value from input field to output field.
Example. A contains 10:20:22(Time) -Input field.
I want to remove the colon from A field and the result should be 102022.

Please let me know is there any function to acheive this.
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: Wed Jun 21, 2006 6:00 pm    Post subject: Re: Convert String value to Numeric Value
Reply with quote

In REXX (you didn't specify what language) you can use a combination of two functions: TRANSLATE (translate the colon to a space) and SPACE (to remove the resulting spaces):

/* REXX */
STR = TIME()
SAY STR
STR = SPACE(TRANSLATE(STR,'',':'),0)
SAY STR
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1224
Location: Israel

PostPosted: Wed Jun 21, 2006 6:29 pm    Post subject:
Reply with quote

I wanted to say that but as I am late here is another possibility (less efficient I think):

/* REXX */
STR = TIME()
SAY STR
PARSE VAR STR HH ':' MM ':' SS
STR = HH || MM || SS
SAY STR
Back to top
View user's profile Send private message
rajesh_mbt

New User


Joined: 27 Mar 2006
Posts: 95
Location: India

PostPosted: Thu Jun 22, 2006 11:26 am    Post subject:
Reply with quote

Moderator / Marso

This is working fine.... Thanks a lot for your help icon_smile.gif
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 convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts convert PD to ZD ram_vizag DFSORT/ICETOOL 5 Sat Nov 05, 2016 3:06 am
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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