Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Use of LMMDISP

420 views
Skip to first unread message

Turriff, Leslie

unread,
Sep 16, 2011, 2:42:55 PM9/16/11
to
Hi,
I've been reading the ISPF Services Guide and trying to puzzle out the proper use of the LMMDISP service, but I'm finding putting together LMINIT, LMMDISP, LMOPEN, … LMCLOSE, LMFREE to be a bit hazy still. I haven't find any examples in the manuals or on the web so far.
Is the following sequence (close to) right?


/* REXX */
Address ISPEXEC
/* Set up dsname, pattern, etc. */
:
"lminit dataid(LISTID) dataset("dsname") enq(SHR)"
"lmmdisp dataid("listid") option(DISPLAY) member("selected") stats(NO) pattern("pattern")"

do while rc = 0
"lmopen dataid("listid") option(INPUT) lrecl(LRECL) recfm(RECFM) org(DSORG)"
:
/* Do something with the selected member(s) */
:
"lmclose dataid("listid")"
"lmmdisp dataid("listid") option(GET) member("selected") stats(NO)"
end
:
"lmfree dataid("listid")
exit

Does anyone out there have a working example that I can scrounge?

Leslie Turriff
ITSD
751-3480


Williams, Charles H

unread,
Sep 16, 2011, 2:52:34 PM9/16/11
to
Leslie,

Here's an example that uses LMMDISP to display a list of members that start with "JCL". I created it as a test member just so I could see how the command worked. It seems to work fine.

/*REXX */
/*USE LMMDISP TO DISPLAY A MEMBER LIST AND ALLOW SELECTION */
/*OF A MEMBER */
/* */
ADDRESS ISPEXEC
PRODTEMP = 'MY.JCL.JCL.CNTL'
SJRNAME='JCL*'
CALL DISPLAY_LIST
EXIT

DISPLAY_LIST:
"LMINIT DATAID(JCLFL) DATASET('"PRODTEMP"')"
IF RC<>0 THEN DO
ZEDSMSG=''
ZEDLMSG='UNABLE TO ACCESS 'PRODTEMP'. BAD RC FROM LMINIT. RC='RC
"SETMSG MSG(ISRZ001)"
RETURN
END
"LMOPEN DATAID("JCLFL") OPTION(INPUT)"
IF RC<>0 THEN DO
ZEDSMSG=''
ZEDLMSG='UNABLE TO ACCESS 'PRODTEMP'. BAD RC FROM LMOPEN. RC='RC
"SETMSG MSG(ISRZ001)"
RETURN
END
ZEDSMSG=' '
ZEDLMSG='SELECT A MEMBER AND PRESS ENTER'
"SETMSG MSG(ISRZ001)"
"LMMDISP DATAID("JCLFL") OPTION(DISPLAY) MEMBER("SJRNAME")",
"STATS(NO) CURSOR(ZLLCMD)"
SELECT
WHEN RC = 0 THEN DO
ZEDSMSG='MEMBER SELECTED'
ZEDLMSG='MEMBER SELECTED'
SJRNAME=ZLMEMBER
"SETMSG MSG(ISRZ001)"
RETURN
END
WHEN RC = 4 THEN DO
ZEDSMSG=''
ZEDLMSG='NO MEMBERS MATCHED SELECTION CRITERIA'
"SETMSG MSG(ISRZ001)"
RETURN
END
WHEN RC = 8 THEN DO
ZEDSMSG=''
ZEDLMSG='END OR RETURN ISSUED. NO MEMBERS SELECTED.'
"SETMSG MSG(ISRZ001)"
RETURN
END
OTHERWISE DO
ZEDSMSG=''
ZEDLMSG='UNABLE TO ACCESS 'PRODTEMP'. BAD RC FROM LMMDISP. RC='RC
"SETMSG MSG(ISRZ001)"
RETURN
END
END /*SELECT*/
IF RC<>0 THEN DO
END
"LMMDISP DATAID("JCLFL") OPTION(FREE)"
"LMFREE DATAID("JCLFL")"
RETURN





Charles Williams
Charles.H...@oa.mo.gov

This communication is being transmitted by ITSD-DSS and is confidential, privileged, and intended only for the use of the recipient named above. If you are not the intended recipient, unauthorized disclosure, copying, distribution or use of the contents is strictly prohibited. If you have received this in error, please notify the sender and destroy the material received.

Steve Comstock

unread,
Sep 16, 2011, 4:49:46 PM9/16/11
to
Well, here's a code fragment from our course "Developing Dialog
Manager Applications in z/OS":


get_libname = 'MORE'
DO UNTIL get_libname = 'DONE'
"ispexec display panel(testdisp)"
if rc = 8 then get_libname = 'DONE'
else do
"ispexec lminit dataid(libid) dataset('"lname"') enq(shr)"
"ispexec lmopen dataid("libid")"
if rc > 0
then do
say 'LMINIT failed for ' lname
get_libname = 'DONE'
end /* error handle lminit */
else do
list_pross = 'MORE'
do until list_pross = 'DONE'

"ispexec lmmdisp dataid("libid") option(display)"
if rc = 0
then do

list_more = 'yes'

do until list_more = 'no'

/* ==> process current member here <== */

/* then get next member to process: */

"ispexec lmmdisp dataid("libid") option(get)"
if rc = 8 then list_more = 'no'

end /* process one member in list */

end /* successful list build */

else do
list_pross = 'DONE'
"ispexec lmmdisp dataid("libid") option(free)"
end /* done or error on select */

end /* process members in list */

end /* display member list */

"ispexec lmclose dataid("libid")"
"ispexec lmfree dataid("libid")"

end /* display data entry panel */
end /* do until get_libname = DONE */


(hope the cut-and-paste works OK; it wiped out the
spacing so I had to manually do that)

The trickiest part is mostly the punctuation.

Course details at:

http://www.trainersfriend.com/TSO_Clist_REXX_Dialog_Mgr/a810descrpt.htm


--

Kind regards,

-Steve Comstock
The Trainer's Friend, Inc.

303-393-8716
http://www.trainersfriend.com

Turriff, Leslie

unread,
Sep 19, 2011, 10:09:24 AM9/19/11
to
William and Steve,
Thanks for the examples! I see that I was sort of on the right track, but not quite right.
Much obliged.

Leslie Turriff
ITSD
751-3480

adrianstern

unread,
Sep 20, 2011, 6:23:35 AM9/20/11
to
> 303-393-8716begin_of_the_skype_highlighting            303-393-8716      http://www.trainersfriend.com

you teach this stuff which is a little frightening since you repeat
your addressing whch is not only unnecessary but unless things have
changed an added overhead as the environment is built every time - a
relic of Exec2 programming?

Steve Coalbran

unread,
Sep 21, 2011, 2:39:08 AM9/21/11
to
Hi Leslie,
Here's a working example I just put together (tested once!)
It just does counts but the skeleton is there... (take away the '| ' prefix to lines)

| /*REXX*/ TRACE "N"
| ARG mask .
| IF( mask="" )THEN mask = "*"
| g. = 0
| ADDRESS ISPEXEC
| "CONTROL ERRORS RETURN"
| "LMINIT DATAID(PDS) DDNAME(SYSIPDS) ENQ(SHR)"
| "LMOPEN DATAID(&PDS) OPTION(INPUT)"
| mn = ""
| IF( mask<>'' )THEN mask = "PATTERN("mask")"
| "LMMLIST DATAID(&PDS) MEMBER(MN) STATS(NO)" mask
| g.0MEMBER = 0
| DO m = 1 BY 1 WHILE(RC=0)
| "LMMFIND DATAID(&PDS) MEMBER(&MN) LRECL(LR) RECFM(RF) STATS(NO)"
| g.0MEMBER = g.0MEMBER + 1
| n = g.0MEMBER
| g.0LINES.n = 0
|
| "LMGET DATAID(&PDS) MODE(INVAR)",
| "DATALOC(LN) DATALEN(DL) MAXLEN(80)"
| DO WHILE( RC = 0 )
|
| g.0LINES.n = g.0LINES.n + 1
| CALL ONELINER ln
|
| "LMGET DATAID(&PDS) MODE(INVAR)",
| "DATALOC(LN) DATALEN(DL) MAXLEN(80)"
| END
|
| SAY "MEMBER="mn "CONTAINS" g.0LINES.n "LINES."
| g.0LINES = g.0LINES + g.0LINES.n
|
| "LMMLIST DATAID(&PDS) MEMBER(MN) STATS(NO)" mask
| END
| "LMMLIST DATAID(&PDS) OPTION(FREE)"
| "LMCLOSE DATAID(&PDS)"
| "LMFREE DATAID(&PDS)"
| SAY
| SAY g.0MEMBER "MEMBERS PROCESSED. AT TOTAL OF" g.0LINES "LINES."
| SAY
|
| EXIT
|
| /*===================================================================*/
| /* process one line of member */
| /*===================================================================*/
| ONELINER: PROCEDURE EXPOSE g. ;TRACE "N"
| PARSE ARG ln
| /* add line level processing here? */
| RETURN
|

> Date: Fri, 16 Sep 2011 13:42:16 -0500
> From: Leslie....@OA.MO.GOV
> Subject: Use of LMMDISP
> To: ISP...@LISTSERV.ND.EDU
0 new messages