My requirement is I have been given a ps file. Let's say the PS file is a cobol code and it has a key word 'ABC' . I need to verify whether ABC starts from a particular column say 8. If it is not then I need to change it to column 8 and write it in a NEW PS File. Similarly I need to do this for 'EDF' too. So I would like to know how do I get started with this.
The above code is a part of a cobol program. I also need to make sure all the 'TO' variables are starting at col40 too. So it's like a review/correction that needs to be done on the input file and give a final sorted output file
I meant what you have done in the script. I told you I am a beginner. I am still learning. I need a heads up or lead from where I could start with the logic
Joined: 10 May 2007 Posts: 2253 Location: Hampshire, UK
Look up the functions that del with WORDs and POSitions
That will tell you if the word is on a line and where it is
Split the line and re-assemble with extra/fewer blanks to align as you want
But, what if the position (40) is not blank? Where is the second part of the line to be positioned? A new line?
Yes Nic , a new line. But then we should also identify if the entire string can be accommodated in a single line without changing the starting position of the string. If it fails it then we should move to a new line starting from the variable that needs to come at the 40 position.