binuraj_s
New User
Joined: 14 Sep 2005 Posts: 4
|
|
|
|
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 |
|