View previous topic :: View next topic
|
Author |
Message |
amolj
New User
Joined: 08 Nov 2006 Posts: 21 Location: india
|
|
|
|
hi all.....
my requirement is
1. there is a seqential file .. TEBTOTS.REXX.DSN1
it is having a 1 string ...
FRANK
2. now i want to insert 3 strings 'BLUE' ,'RED' , 'ORANGE' after the string 'FRANK'
i have written a following REXX code for this requirement
Code: |
/* REXX */
STRING = 'FRANK'
ADDRESS ISPEXEC 'VPUT STRING'
ADDRESS ISPEXEC "EDIT DATASET('TEBTOTS.REXX.DSN1') MACRO(MYMACRO)"
EXIT
|
MYMACRO:
Code: |
/* REXX*/
ADDRESS ISREDIT "MACRO (STRING)"
ADDRESS ISREDIT "SCAN OFF"
ADDRESS ISREDIT "SEEK " STRING " FIRST"
LINE3 = 'BLUE'
LINE2 = 'RED'
LINE1 = 'ORANGE'
"F" STRING
IF RC > 0 THEN EXIT
ADDRESS ISREDIT "(FRED) = "CURSOR
ADDRESS ISREDIT "LINE_AFTER "FRED " = " (LINE1)
ADDRESS ISREDIT "LINE_AFTER "FRED+1"= " (LINE2)
ADDRESS ISREDIT "LINE_AFTER "FRED+2"= " (LINE3)
ADDRESS ISREDIT "SAVE"
RETURN
|
* but when i execute this code i m able to get in to the dataset TEBTOTS.REXX.DSN1 in the edit mode ..... but i m getting a following error msg.......
IKJ56500I COMMAND MYMACRO NOT FOUND
***
...... it is not able to find the macro MYMACRO .....
i m new to REXX ... can anyone help in executing this code properly..... |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Put MYMACRO in the same library as your first REXX.
O. |
|
Back to top |
|
|
amolj
New User
Joined: 08 Nov 2006 Posts: 21 Location: india
|
|
|
|
hi ofer71...
actually i m using internal macro ... so MYMACRO is present in the code itself...
also i tried by the following way ...
ADDRESS ISPEXEC "EDIT DATASET('TEBTOTS.REXX.DSN1') MACRO()"
CALL MYMACRO
.... by calling it seperately...
but i m not sure whether my above approach is correct ???
please help me... |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Quote: |
actually i m using internal macro ... so MYMACRO is present in the code itself... |
This is the first time I encounter the term "internal macro". Can you please explain what do you mean by that?
O. |
|
Back to top |
|
|
amolj
New User
Joined: 08 Nov 2006 Posts: 21 Location: india
|
|
|
|
... internal macro .. means ...the macro is just after the code in same file .... following is my code
/* REXX */
STRING = 'FRANK'
ADDRESS ISPEXEC 'VPUT STRING'
ADDRESS ISPEXEC "EDIT DATASET('TEBTOTS.REXX.DSN1') MACRO()"
CALL MYMACRO
EXIT
MYMACRO:
ADDRESS ISREDIT "MACRO (STRING)"
ADDRESS ISREDIT "SCAN OFF"
ADDRESS ISREDIT "SEEK " STRING " FIRST"
LINE3 = 'BLUE'
LINE2 = 'RED'
LINE1 = 'ORANGE'
ADDRESS ISREDIT "FIND" STRING
ADDRESS ISREDIT "(FRANK) = "CURSOR
ADDRESS ISREDIT "LINE_AFTER " LINE1
ADDRESS ISREDIT "SAVE"
RETURN
..... THE MACRO IS PRESENT in the code itself.... |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
This is an internal routine.
Edit macros must be saved as seperate members. First statement of the edit-macro member must be "address isredit macro...".
O. |
|
Back to top |
|
|
amolj
New User
Joined: 08 Nov 2006 Posts: 21 Location: india
|
|
|
|
hi ...
i tried by keeping MYMACRO as a seperate member in the same PDS where rexx code is present .....
it is giving the same error command MYMACRO not found....
please help me... |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Here is the explanation from the fine manual:
Quote: |
Explanation: A CLIST or REXX exec to be implicitly executed could not be found. The error message displays the command that was not found. Check that the command you specified is valid or spelled correctly. |
Please re-check the name of the member and the name supplied in the EDIT service.
O. |
|
Back to top |
|
|
|