IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Macro filed when Open the jcl with macro


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Thu Jun 29, 2006 5:03 pm
Reply with quote

hi all,

i have just started studying REXX. while creating macros for the opening of copy books or the dataset mentioned in the jcl, i had a problem. while i tried to open the jcl with imacro, the macro starts running and get failed. i want my macro to run only when the enter key is pressed. can anyone help me on this case.
Back to top
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Thu Jun 29, 2006 5:03 pm
Reply with quote

hi this is the macro program i have written for that
Code:

/* REXX */
"MACRO"                           
ADDRESS ISREDIT                   
X = MSG('OFF')                     
"(NUM) = LINENUM ".ZCSR           
"(LNCONT) = LINE "NUM             
IND = INDEX(LNCONT,"'")           
DSN = SUBSTR(LNCONT,IND+1)         
DSN  = STRIP(STRIP(DSN),B,"'")     
DSN = "'"||DSN||"'"               
SAY DSN                           
IF SYSDSN(""DSN"")= 'OK' THEN     
 DO                               
   ADDRESS ISPEXEC                 
  "VIEW DATASET("DSN") MACRO(RES)"
 END                               
EXIT
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Jun 30, 2006 1:26 am
Reply with quote

I would call the ISPF EDIT session with a panel:

Do Forever
"ISPEXEC EDIT DATASET('dsname') PANEL(thepanel)"
If rc <> 0 Then Exit
Else (call EDIT with the macro)...
End

With a panel, you can process the Return-code based on Enter (rc=0) or End (rc=8). When rc=0, then call EDIT again, this time without the panel, but with the macro.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Calling an Open C library function in... CICS 1
No new posts PRINTOUT macro PL/I & Assembler 0
No new posts Open VSAM File in IMS DC Region - DFS... IMS DB/DC 0
No new posts create rexx edit Macro that edits the... CLIST & REXX 3
No new posts Issues with executing a REXX MACRO th... TSO/ISPF 4
Search our Forums:

Back to Top