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: 1060
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 line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
No new posts PLI - printing from multiple programs Pedro PL/I & Assembler 8 Fri Sep 08, 2017 6:36 am
No new posts How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm

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