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

String manipulation spanning multiple lines


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
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
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: 1306
Location: Vilnius, Lithuania

PostPosted: Mon Oct 19, 2009 12:30 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top