Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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

Active Member


Joined: 07 Feb 2009
Posts: 989
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 syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Insert Lines in JCL with Rexx after a... Willy Jensen CLIST & REXX 3 Tue Aug 30, 2016 4:18 pm
No new posts Random Password (in string format) ge... ezhavendhan COBOL Programming 10 Mon Aug 29, 2016 3:18 pm
No new posts How to insert a lengthy string havin... vidyaa DB2 7 Thu Aug 25, 2016 5:20 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us