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
 
Need help on string manupulation in REXX

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

New User


Joined: 20 Jan 2004
Posts: 42

PostPosted: Wed Sep 24, 2008 1:53 pm    Post subject: Need help on string manupulation in REXX
Reply with quote

Hi,

I would like to change the below line

FROM

=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
****** ***************************** Top of Data ******************************
000001 05 FILLER PIC X(22) VALUE 'XXXXXXXXXXXXXXX'.

TO

=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
****** ***************************** Top of Data ******************************
000001 05 FILLER PIC X(22) VALUE
000002 'XXXXXXXXXXXXXXXXXXXXXX'.
****** **************************** Bottom of Data ****************************

Is there any possibility of changing as above using string concepts in REXX...

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

hchinnam

New User


Joined: 18 Oct 2006
Posts: 73

PostPosted: Wed Sep 24, 2008 4:31 pm    Post subject:
Reply with quote

This piece of code should do.

Code:


"ISREDIT (SEGLINE) = LINE .ZF"       
SEGL1 = SUBSTR(SEGLINE,1,29)         
SEGL2 = SUBSTR(SEGLINE,29,51)       
"ISREDIT LINE .ZF = (SEGL1)"         
"ISREDIT LINE_AFTER .ZF = (SEGL2)"   



However you might need to customize it based on your requirement.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Wed Sep 24, 2008 5:14 pm    Post subject: Reply to: Need help on string manupulation in REXX
Reply with quote

the snippet will only manipulate the line ...

here is the snippet
Code:
line0 = "05 FILLER PIC X(22) VALUE 'XXXXXXXXXXXXXXX'."
say "line0  >>" || line0 || "<<"
offst = pos("VALUE",line0)
line1 = left(line0, offst+5)
line2 = substr(line0,offst+6)
say "line1  >>" || line1 || "<<"
say "line2  >>" || line2 || "<<"


here is the result
Code:
line0  >>05 FILLER PIC X(22) VALUE 'XXXXXXXXXXXXXXX'.<<
line1  >>05 FILLER PIC X(22) VALUE <<
line2  >>'XXXXXXXXXXXXXXX'.<<
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 line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
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