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
 
Strip punctuation

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

New User


Joined: 29 Jul 2009
Posts: 7
Location: Kansas

PostPosted: Fri Sep 04, 2009 12:32 am    Post subject: Strip punctuation
Reply with quote

I just need a simple mainframe REXX program that will read a sequential file as input, strip all the punctuation and spaces out of one of the fields, and then write the entire record back out.

Can anyone help? Our REXX programmer is out until next Tuesday and I need to get this completed before then.

Thanks!
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10375
Location: italy

PostPosted: Fri Sep 04, 2009 12:46 am    Post subject: Reply to: Strip punctuation
Reply with quote

i would mildly remind that this is a help forum, not a body rental or do it for me

here are some hints anyway

the TRANSLATE builtin http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IKJ3A320/4.3.64?SHELF=IKJOSE20&DT=20000113164209

the SPACE builtin http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IKJ3A320/4.3.53?SHELF=IKJOSE20&DT=20000113164209

step1 ....
translate all the unwanted chars to spaces ...
Code:
temp = TRANSLATE(from,"    ",",.!?")

step2
compress the intermediate result
Code:
dest = SPACE(temp,0)


search the forums and the manuals for samples and syntax of ...
the EXECIO command http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IKJ3A320/10.3?SHELF=IKJOSE20&DT=20000113164209

but if the dataset is large a sort ( DFSORT/SYNCSORT ) might be better suited,
search the forum for samples
Back to top
View user's profile Send private message
gretchen

New User


Joined: 29 Jul 2009
Posts: 7
Location: Kansas

PostPosted: Fri Sep 04, 2009 1:01 am    Post subject: Reply to: Strip punctuation
Reply with quote

yup, i understand that. i've been checking out REXX commands all day (including the ones you noted) trying to learn it myself. but just got to thinking that this was such a basic issue that someone must have one laying around that they could easily post. thanks anyway.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10375
Location: italy

PostPosted: Fri Sep 04, 2009 1:25 am    Post subject: Reply to: Strip punctuation
Reply with quote

a quick and dirty approach for procesiing a dataset with a couple thousandth record could be

Code:
Address TSO "EXECIO * READ INDD ( STEM DATA. FINIS
coun = data.0
Do i = 1 to coun
    head   = substr(data.i,1,len0 - 1)
    from   = substr(data.i,1+len0,leng)   
    tail   = substr(data.i,1+len0+leng)
    temp   = TRANSLATE(from,"    ",".,!?")
    dest   = SPACE(temp,0)
    data.i = head || left(dest,leng) || tail
end
Address TSO "EXECIO "coun" WRITE OUTDD ( STEM DATA. FINIS
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Sep 04, 2009 2:07 am    Post subject:
Reply with quote

Hello gretchen and welcome to the forum,

If this is a high-volume file, suggest you reconsider using rexx. . . Rexx is possibly the worst possible choice for "copying" large files.

Depending on your requirement, you may be able to do what you need using your sort product or some other available utility. . .
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 Facing problem in STRIP MadanVS CLIST & REXX 2 Mon Jan 03, 2011 5:59 pm
No new posts usage of strip function in cobol embe... erhema DB2 4 Mon Dec 27, 2010 3:11 pm
No new posts Remove / Strip lines in JCL fredrick andrews JCL & VSAM 8 Mon Nov 08, 2010 4:46 pm
No new posts Cobol String Strip between the spaces xknight COBOL Programming 9 Mon Feb 15, 2010 2:18 pm
No new posts Read record and Strip data from colum... Phalgun CLIST & REXX 5 Sat Nov 14, 2009 9:41 pm

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