View previous topic :: View next topic
|
Author |
Message |
Arun Kumar S
New User
Joined: 23 Jan 2009 Posts: 14 Location: Bangalore
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Post the macro code |
|
Back to top |
|
|
Arun Kumar S
New User
Joined: 23 Jan 2009 Posts: 14 Location: Bangalore
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
So where is the code for the macro PREP ??? |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Just a guess - do you have "ADDRESS ISREDIT END" at the end of your macro?
O. |
|
Back to top |
|
|
Arun Kumar S
New User
Joined: 23 Jan 2009 Posts: 14 Location: Bangalore
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
rsshanmugam
New User
Joined: 08 Mar 2005 Posts: 62 Location: Basildon
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
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 |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1315 Location: Vilnius, Lithuania
|
|
|
|
What will happen if your user uses a 160x62 screen....
Or in simple terms, your code is crap! |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
any reason to resurrect a 9(NINE) years old topic |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Locking old topic. If you really cannot figure it out yourself then start a new topic. |
|
Back to top |
|
|
|