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
 
String manipulation spanning multiple lines

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
binuraj_s

New User


Joined: 14 Sep 2005
Posts: 4

PostPosted: Fri Oct 16, 2009 9:16 am    Post subject: String manipulation spanning multiple lines
Reply with quote

Hi All,
I have an I/P file as follows.

********************Start of file*******************************
Please come and see me on &Date1 at &Time and if you don't find me, kindly leave a short message at my office reception.I shall come and
meet you the same day.If I dont show up the same day, I shall surely come and meet you on &Date2 at &Time2.Hope to see you soon and have a wonderful vacation.
********************End of File********************************

Now in the above file the you can see some text prefixed by '&'. These are dynamic texts or in other words, their value will be figured out in the program and the the text will have to replaced with their actual values.
For eg:- &Date1= September 1,2009. So once all the dynamic texts are replaced, the file will look something like below.

********************Start of file*******************************
Please come and see me on September 1, 2009 at 10:30 AM and if you don't find me, kindly leave a short message at my office reception.I shall come and meet you the same day.If I dont show up the same day, I shall surely come and meet you on September 10 2009 at 10:00 AM.Hope to see you soon and have a wonderful vacation.
********************End of File********************************

Now my question is whether there are any commands within PL/1 to do these operations in a quicker way. I know I can achieve this by reading the file line by line and replacing the dynamic texts , but then I will also have to shift the remaining words in the line appropriately(as the length of the dynamic texts are longer than the corresponding '&' variables) and this will result in pushing some of the words to the next line and so on. So though cumbersome, its achievable, but I was wondering, whether some of the commands like EDIT PUT using appropriate FORMAT command can do the trick. Im relatively new to PL/1 and have not tried much of the commands.
Kindly let me know if any of you have done something of similar fashion in PL/1

Regards,
B
Back to top
View user's profile Send private message

prino

Senior Member


Joined: 07 Feb 2009
Posts: 1101
Location: Oostende, Belgium

PostPosted: Mon Oct 19, 2009 12:30 am    Post subject:
Reply with quote

PL/I is a programming language, not a text formatting tool. You are the programmer, go figure...
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 -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Reformatting and adding additional fi... Badbeef SYNCSORT 6 Thu Apr 05, 2018 4:45 pm
No new posts Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am
No new posts write multiple lines in PS file in cobol Balu5491 COBOL Programming 7 Wed Mar 07, 2018 10:27 am
No new posts Find a string in PS file opened in br... mukkas CLIST & REXX 3 Sat Feb 24, 2018 2:15 pm
No new posts Using multiple routines at exit 6 in ... Randy Horowitz All Other Mainframe Topics 2 Sat Feb 10, 2018 11:57 pm

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