Hi
My requirement is to insert a line into a cobol pgm with some requirements
For example,
i will give a input variable thru my REXX code which is declared as a variable in workkingstorage division.
1) That variable should be inserted only in the procedure division only
2) Then if that variable comes inside the procedure division for 10 times in different places, i want to insert 10 lines whereever the variable is found
eg) working-storage section.
ws-eof pic x(10)
procedure division.
ws-eof
------ < = i want to insert here DISPLAY "WS-EOF"
ws-eof
Thanks paddy
But when i tested this program,it is inserting when it is finding the variable first time.but I had that variable 10 times, i want to insert in 10 separate line also.
is there any way of using line_after and seek command
Joined: 12 Sep 2005 Posts: 46 Location: Paris France
hi Mainfrae,
This procedure inserts one line each time when it reach the variable. If one line contain several occurences of the designated variable then the procedure will not work well. Normally it must read each line of source file an reach the variable into. With my test file the procedure has inserted one line every time it reached variable. Perhaps what i not well understood your problem.
Before
Code:
******,***************************** Top of Data ******************************
000001,AAAAAAAAAAAAAAAAAAAAAAA
000002,BBBBBBBBBBBBBBBBBBBBB
000003,WEOF
000004,EEEEEEEEEEEEEEEEE
000005,AAAAAAAAAAAAAAAAAAAAAAA
000006,BBBBBBBBBBBBBBBBBBBBB
000007,WEOF
000008,EEEEEEEEEEEEEEEEE
000009,AAAAAAAAAAAAAAAAAAAAAAA
000010,WEOF
000011,END OF PROG
******,**************************** Bottom of Data ****************************
After
Code:
******,***************************** Top of Data ******************************
000001,AAAAAAAAAAAAAAAAAAAAAAA
000002,BBBBBBBBBBBBBBBBBBBBB
000003,WEOF
000004,DISPLAY WEOF
000005,EEEEEEEEEEEEEEEEE
000006,AAAAAAAAAAAAAAAAAAAAAAA
000007,BBBBBBBBBBBBBBBBBBBBB
000008,WEOF
000009,DISPLAY WEOF
000010,EEEEEEEEEEEEEEEEE
000011,AAAAAAAAAAAAAAAAAAAAAAA
000012,WEOF
000013,DISPLAY WEOF
000014,END OF PROG
******,**************************** Bottom of Data ****************************