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

Issuing ISREDIT MACRO cmd to a member from another REXX pgm


IBM Mainframe Forums -> TSO/ISPF
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
Arun Kumar S

New User


Joined: 23 Jan 2009
Posts: 14
Location: Bangalore

PostPosted: Wed Feb 04, 2009 4:17 pm
Reply with quote

Hi Frnds,

I want to issue the ISREDIT MACRO command to a member from another REXX program. I'm using the below stmt to issue the command. But its opening the member in view mode and issuing.

"ISPEXEC VIEW DATAID(&DSNM) MEMBER("MEM") MACRO(PREP)"

I wanted this to be done without opening the member physically.

Any suggestions are welcome
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Feb 04, 2009 4:23 pm
Reply with quote

Post the macro code
Back to top
View user's profile Send private message
Arun Kumar S

New User


Joined: 23 Jan 2009
Posts: 14
Location: Bangalore

PostPosted: Wed Feb 04, 2009 5:01 pm
Reply with quote

The below code is to PREP all the jcls in a jcllib and to create the GDG's which is not created
Code:

/* REXX */                                                             
MYPDS = OFRT.TT.FOOD.HOFFR.EXTR.JCLLIB                                 
LIMIT = 10                                                             
"ISPEXEC LMINIT DATAID(DSNM) DATASET('"MYPDS"') ENQ(SHR)"               
"ISPEXEC LMOPEN DATAID(&DSNM) OPTION(INPUT)"                           
DO FOREVER                                                             
  "ISPEXEC LMMLIST DATAID(&DSNM) OPTION(LIST) MEMBER(MEM) STATS(YES)"   
  IF RC <> 0 THEN LEAVE                                                 
  CALL PREP                                                             
END                                                                     
"ISPEXEC LMCLOSE DATAID(&DSNM)"                                         
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
PREP:                                                                   
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
MEM = STRIP(MEM,B)                                                     
/* "JCLPREP '"MYPDS"("MEM")'" */                                       
"ISPEXEC VIEW DATAID(&DSNM) MEMBER("MEM") MACRO(PREP)"                 
CALL CGDG                                                               
RETURN                                                                 
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
CGDG:                                                                   
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
DSNAME = USERID() || .JCLPREP.REPORT                                   
DSNIN. = ' '                                                           
GDGIN. = ' '                                                           
J=0                                                                     
"ALLOC DA('"DSNAME"') F(INFILE) SHR"                                   
"EXECIO * DISKR INFILE (FINIS STEM DSNIN."                             
"FREE F(INFILE)"                                                       
DO I=1 TO DSNIN.0                                                       
SP = POS('0JCP0546E',DSNIN.I)                                           
IF SP > 0 THEN DO                                                       
   I = I+1                                                             
   J = J+1                                                             
   REC = DSNIN.I                                                       
   PARSE VAR REC WITH DUM1 "'" GDGNAME "(" DUM2 ")"                     
   GDGIN.J = GDGNAME                                                   
END                                                                     
END                                                                     
DO I = 1 TO J                                                           
   GDGNAME = GDGIN.I                                                   
   X=OUTTRAP(LST.)                                                     
   " LISTC ENT('"GDGNAME"')"                                           
   X=OUTTRAP(OFF)                                                       
   IF RC \= 0 THEN                                                     
     DO                                                                 
      "DEFINE GDG (NAME('"GDGNAME"') LIMIT("LIMIT")",                   
         "SCRATCH"                                                     
      IF RC = 0 THEN                                                   
         SAY GDGNAME 'IS CATALOGED'                                     
/*       ZEDSMSG = 'GDG BASE CREATED' */                               
      ELSE                                                             
         SAY GDGNAME 'CATALOG FAILED RC='RC                             
/*       ZEDSMSG = 'GDG BASE FAILED RC='RC */                           
     END                                                               
   ELSE                                                                 
     SAY GDGNAME 'IS ALREADY IN CATALOG'                               
END                                                                     
RETURN
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Feb 04, 2009 5:14 pm
Reply with quote

So where is the code for the macro PREP ???
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Feb 04, 2009 5:18 pm
Reply with quote

Just a guess - do you have "ADDRESS ISREDIT END" at the end of your macro?

O.
Back to top
View user's profile Send private message
Arun Kumar S

New User


Joined: 23 Jan 2009
Posts: 14
Location: Bangalore

PostPosted: Wed Feb 04, 2009 5:45 pm
Reply with quote

No i cannto post the code for PREP as this is Licensed code.

Please tell me if there is anyother way to issue the MACRO command to a member. Other than the blow,

"ISPEXEC VIEW DATAID(&DSNM) MEMBER("MEM") MACRO(PREP)"

I wanted to open the member logically and issue the MACRO command.

Thanks in advance
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Feb 04, 2009 5:48 pm
Reply with quote

There is no such thing as opening a dataset "logically": You either open the dataset or not...However, you can "open and close" if you use my suggestion above.

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

New User


Joined: 08 Mar 2005
Posts: 62
Location: Basildon

PostPosted: Fri Mar 16, 2018 9:17 pm
Reply with quote

ofer71 wrote:
Just a guess - do you have "ADDRESS ISREDIT END" at the end of your macro?

O.


sorry for replying for very old post. i have exact problem. i am able to launch the member using EDIT macro but when i issue 'ISREDIT END' in the edit macro, i am getting the error 'END' is not allowed in the initial macro.

how to exit the member under edit view, when EDIT/Cancel doesnt work.

calling code.
Code:

  outd = ads||".RESL"                                       
                                                             
  ADDRESS "ISPEXEC" "VPUT (outd) PROFILE";                   
                                                             
  "ispexec" "lmerase dataset('"outd"')"                     
  "ALLOC FI(OUTDD) DA('"OUTD"') new CATALOG",               
    " SPACE(100,100) DSORG(PS) RECFM(F,B) LRECL(131) "       
/*   "ispexec LMFREE DATAID("outdd") "; */                   
                                                             
  "ISPEXEC lminit dataid(adsi) dataset('"ads"') enq(shrW)"   
                                                             
  "ISPEXEC LMOPEN DATAID("adsi") OPTION(INPUT) ";           
                                                             
  "ISPEXEC lminit dataid(outdd) dataset('"outd"') enq(shrw)"
Prog = 0                                                           
Prog_T = 0                                                         
                                                                   
                                                                   
j = 1                                                             
                                                                   
DO I = 7 TO LIBMEM.0                                               
   Prog = Prog + 1                                                 
   Prog_T = Prog_T + 1                                             
                                                                   
   if Prog = 100 then do                                           
     say 'no of members Processed..' Prog_T                       
     prog = 0                                                     
   end                                                             
                                                                   
   LIBMEM.I = STRIP(LIBMEM.I)                                     
   memn = LIBMEM.I                                                 
   say memn                                                       
   "ispexec edit dataid("adsi") member("memn") macro("GDGJOBV")"; 
    ADDRESS "ISPEXEC" "VGET (resl) PROFILE";                           
    data.j = strip(resl)                                               
    j = j + 1                                                         
                                                                       
 end                                                                   
                                                                       
 "EXECIO * DISKW outdd  (FINIS STEM data."                             
 "ISPEXEC LMCLOSE DATAID(outdd) ";                                     
 "ISPEXEC LMCLOSE DATAID(adsi) ";                                     
                                                                       
 return                                                               


Edit Macro:
Code:

/* REXX */                                                             
ADDRESS ISREDIT                                                         
ADDRESS ISREDIT "MACRO NOPROCESS"                                       
                                                                       
ADDRESS ISREDIT "EJCK EDCHEL SE(10)"                                   
ADDRESS ISPEXEC "CONTROL NONDISPL END"                                 
ADDRESS TSO "ISREMSPY"                                                 
ADDRESS ISPEXEC 'VGET (ZSCREENW,ZSCREEND)'                             
                                                                       
ADDRESS ISPEXEC "VGET ZSCREENI"                                         
                                                                       
LINE = SUBSTR(ZSCREENI,1,80)                                           
                                                                       
ocnt = 1                                                               
oct  = 1                                                               
                                                                       
 Do until ocnt > 20                                                     
                                                                       
     line = substr(zscreeni,1,80)                                       
    zscreeni = delstr(zscreeni,1,80)                                   
                                                                       
    If Left(line,8) = " Command" | Left(line,9) = "  -------" |,       
       Left(line,9) = " EDIT    " Then NOP                             
    Else Do                                                           
      line = Strip(line)                                               
      char8  = SubStr(line,8,1)                                       
      char9  = SubStr(line,9,1)                                       
      char10 = SubStr(line,10,1)                                       
                                                                       
      retval8  = c2x(char8)                                           
      retval9  = c2x(char9)                                           
      retval10 = c2x(char10)                                           
                                                                       
      chars = retval8||retval9||retval10                               
                                                                       
      If chars = '151515' Then Do                                     
        line = Left(line,7)                                           
      End                                                             
       oline.oct  = line                                               
       oct = oct + 1                                                   
                                                                       
     End                                                               
       ocnt = ocnt + 1                                                 
  End                                                                   
                                                                       
Write_Resu:                                                             
  srch = 'FLAGGED IN JOB'                                               
  oct = 1                                                               
  do until oct > 15                                                     
                                                                       
   text1 = oline.oct                                                   
   pos1 = pos(srch,text1)                                               
                                                                       
   if pos1 > 0 then                                                     
    do                                                                 
     pos1 = pos1 + 15                                                   
     resl = substr(text1,pos1,37)                                       
     ADDRESS "ISPEXEC" "VPUT (resl) PROFILE";                           
                                                                     
    end                                                             
   oct = oct + 1                                                     
  end                                                               
                                                                     
 ADDRESS ISREDIT "END"                                                           
                                                                     
EXIT                                                                 


Error message:


Code:


******************************************************************************
*                                                                            *
* Command in error . : END                                                   *
*                                                                            *
* Initial macro error                                                        *
* The macro command entered is not allowed from an initial macro.            *
*                                                                            *
*   Error message ID . : ISRE310                                             *
*                                                                            *
*   Last return code . : 20                                                  *
*                                                                            *
*   Macro executing  . : GDGJOBV                                             *
*                                                                            *
* Press ENTER key to terminate the macro.                                    *
*                                                                            *
*                                                                            *
*                                                                            *
******************************************************************************


basically, i want to run my edit macro GDGJOBV in every member of a PDS. the only problem i have is, the Macro is not closing the member and go for another member without human intervention.

as the END is not working in the EDIT macro. what is the other options.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Fri Mar 16, 2018 10:02 pm
Reply with quote

It is lying to you. This works just fine in an initial macro:
Code:
/*resxx*/ Address ISREDIT
"MACRO"
"END"


Which leads me to believe that something in your macro is adding a restriction. Try removing the 'CONTROL NONDISPL END' and the 'ISREMSPY'.

I would start with my simple example and then start adding parts of our macro to see which statements cause the restriction.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Fri Mar 16, 2018 10:43 pm
Reply with quote

What will happen if your user uses a 160x62 screen....

Or in simple terms, your code is crap!
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Mar 16, 2018 10:45 pm
Reply with quote

any reason to resurrect a 9(NINE) years old topic icon_question.gif
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sat Mar 17, 2018 2:35 am
Reply with quote

Locking old topic. If you really cannot figure it out yourself then start a new topic.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
Search our Forums:

Back to Top