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

Strip punctuation


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Sep 04, 2009 12:46 am
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 publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IKJ3A320/4.3.64?SHELF=IKJOSE20&DT=20000113164209

the SPACE builtin 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 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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Sep 04, 2009 1:25 am
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

Moderator Emeritus


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

PostPosted: Fri Sep 04, 2009 2:07 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Rexx STRIP Equivalent function in CLIST CLIST & REXX 5
No new posts Need to strip off first line - ascii ... DFSORT/ICETOOL 7
No new posts Facing problem in STRIP CLIST & REXX 2
No new posts usage of strip function in cobol embe... DB2 4
No new posts Remove / Strip lines in JCL JCL & VSAM 8
Search our Forums:

Back to Top