Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

unable to insert a string in sequential file using REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
amolj

New User


Joined: 08 Nov 2006
Posts: 21
Location: india

PostPosted: Wed Nov 08, 2006 12:34 pm    Post subject: unable to insert a string in sequential file using REXX
Reply with quote

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 .....
icon_arrow.gif i m new to REXX ... can anyone help in executing this code properly.....
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Wed Nov 08, 2006 3:20 pm    Post subject:
Reply with quote

Put MYMACRO in the same library as your first REXX.

O.
Back to top
View user's profile Send private message
amolj

New User


Joined: 08 Nov 2006
Posts: 21
Location: india

PostPosted: Wed Nov 08, 2006 4:56 pm    Post subject: hi
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Wed Nov 08, 2006 5:21 pm    Post subject:
Reply with quote

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
View user's profile Send private message
amolj

New User


Joined: 08 Nov 2006
Posts: 21
Location: india

PostPosted: Wed Nov 08, 2006 5:39 pm    Post subject:
Reply with quote

... 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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Wed Nov 08, 2006 5:44 pm    Post subject:
Reply with quote

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
View user's profile Send private message
amolj

New User


Joined: 08 Nov 2006
Posts: 21
Location: india

PostPosted: Wed Nov 08, 2006 5:58 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Wed Nov 08, 2006 7:05 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us