Re: Having a little difficulty with a REXX command LMOPEN

2023-02-08 Thread Paul Gorlinsky
Calling system programs from COBOL is doable provided you use the correct 
calling conventions. 

I OS we have two different ways of passing parms ... Generally see 
https://www.ibm.com/docs/en/cobol-zos/6.3?topic=statements-call-statement

by Reference, content or value...


Check out 
https://www-40.ibm.com/servers/resourcelink/svc00100.nsf/pages/zOSV2R4sa380684/$file/ceea400_v2r4.pdf
 
z/OS Language Environment Writing Interlanguage Communications Applications 
SA38-0684

For Additional Help

Also : See 
https://www.ibm.com/docs/en/zos/2.1.0?topic=program-writing-jcl-command-execution
 

There are three different ways to run under the TSO TMP...
IKJEFT01, IKJEFT1A and IKJEFT1B

Usually IKJEFT01 will result in a return code of ZERO ( 0 ) provide SYSTSIN and 
SYSTSPRT DD statements exist and are valid

IKJEFT1A will return S04C if a system abend occurs in a program or command be 
executed ... 

IKJEFT1B will return the return code of the last command's return code...
--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Having a little difficulty with a REXX command LMOPEN

2023-02-08 Thread Steve Thompson

I am doing some utility routines for a product I'm working on.

I have used ISPQRY in REXX code but that was under IKJEFT* (I 
have tried it with various combinations).


So I thought I'd just stick a dynamic call to ISPQRY into a COBOL 
program and have it spit out what it got back.


So, if the LOAD failed, I'd probably get a S806 -- But as someone 
noted, if it was in a "global" library(s) (I didn't go run it 
down to see if it was specifically in "LPA"). And so I got RC=20 
from it.


Now, this is in preparation for that same COBOL program to do 
BPXWDY2 (entry into BPXWDYN), and ISPF/PDF LM* code to find 
members in the passed in DSN.


The next test will be after putting in the requisite ISPF DDs and 
see how that functions.


But the point is, ISPQRY did function and tell me that the 
environment was not there.


I'm hoping that I can do this without having to use IKJEFT* .

Regards,
Steve Thompson

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Having a little difficulty with a REXX command LMOPEN

2023-02-06 Thread Hobart Spitz
Just taking a guess here:  Most ISPF services run at the same task level as
the invoking user program.  I believe that EDIT (and View) run at a
different task level, and therefore may not have access to the same
parameter pointers.


OREXXMan
Q: What do you call the residence of the ungulate with the largest antlers?
A: A moose pad.
:-D
Would you rather pass data in move mode (*nix piping) or locate mode
(Pipes) or via disk (JCL)?  Why do you think you rarely see *nix commands
with more than a dozen filters, while Pipelines specifications are commonly
over 100s of stages, and 1000s of stages are not uncommon.
REXX is the new C.


On Mon, Feb 6, 2023 at 10:32 AM Paul Gilmartin <
042bfe9c879d-dmarc-requ...@listserv.ua.edu> wrote:

> On Mon, 6 Feb 2023 15:29:01 +, Seymour J Metz  wrote:
>
> >It follows TSO command conventions, so in that sense it is a TSO command,
> but it is in an ISPF library.
> >
> So 'ADDRESS TSO  "ISPQRY"' fails if ISPF libraries are not allocated?
>
> Did you mean trimodal?
>
> By "bimodal" I meant ISPF vs. non-ISPF.  There are numerous modes.  I
> start some scripts with:
> ADDRESS ISREDIT MACRO X
> IF RC<>0 THEN PARSE ARG X
>
> I feel that ISPF designers show contempt for REXX in eschewing REXX
> facilitird such as
> PARSE ARG, and especially compound symbols.
>
> 
> From: Paul Gilmartin
> Sent: Monday, February 6, 2023 9:53 AM
>
> On Mon, 6 Feb 2023 04:48:09 +, Seymour J Metz wrote:
>
> >I would probably use ISPQRY, but your usage is shorter.
> >
> But does that require TSO?  I wanted to be TSO-independent:
>
> z/OS 2.5  ISPF Services Guide
> IBM   SC19-3626-50
>
> Under TSO/E REXX that uses ADDRESS TSO you can use:
> "ISPQRY"
>
> (if it's a TSO command, shouldn't it be documented in the TSO COmmanf
> Ref.?)
>
> 
> From: Paul Gilmartin
> Sent: Sunday, February 5, 2023 9:02 PM
> >...
> Thrtr are scripts intended to be bimodal where I have dome:
> ADDRESS ISPEXEC DISPLAY 'MSG(ISRZ002)'
> IF RC<>0 THEN DO  /* ISPF not active.  */
>   say errMsg1
>   say errMsg2;  END
>
> --
> gil
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Having a little difficulty with a REXX command LMOPEN

2023-02-06 Thread Seymour J Metz
ISPQRY fails if it is not in LPA, linklist or tasklib,

So you don't require that it work also in System REXX?


From: IBM Mainframe Discussion List  on behalf of 
Paul Gilmartin <042bfe9c879d-dmarc-requ...@listserv.ua.edu>
Sent: Monday, February 6, 2023 11:32 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Having a little difficulty with a REXX command LMOPEN

On Mon, 6 Feb 2023 15:29:01 +, Seymour J Metz  wrote:

>It follows TSO command conventions, so in that sense it is a TSO command, but 
>it is in an ISPF library.
>
So 'ADDRESS TSO  "ISPQRY"' fails if ISPF libraries are not allocated?

Did you mean trimodal?

By "bimodal" I meant ISPF vs. non-ISPF.  There are numerous modes.  I start 
some scripts with:
ADDRESS ISREDIT MACRO X
IF RC<>0 THEN PARSE ARG X

I feel that ISPF designers show contempt for REXX in eschewing REXX facilitird 
such as
PARSE ARG, and especially compound symbols.


From: Paul Gilmartin
Sent: Monday, February 6, 2023 9:53 AM

On Mon, 6 Feb 2023 04:48:09 +, Seymour J Metz wrote:

>I would probably use ISPQRY, but your usage is shorter.
>
But does that require TSO?  I wanted to be TSO-independent:

z/OS 2.5  ISPF Services Guide
IBM   SC19-3626-50

Under TSO/E REXX that uses ADDRESS TSO you can use:
"ISPQRY"

(if it's a TSO command, shouldn't it be documented in the TSO COmmanf Ref.?)


From: Paul Gilmartin
Sent: Sunday, February 5, 2023 9:02 PM
>...
Thrtr are scripts intended to be bimodal where I have dome:
ADDRESS ISPEXEC DISPLAY 'MSG(ISRZ002)'
IF RC<>0 THEN DO  /* ISPF not active.  */
  say errMsg1
  say errMsg2;  END

--
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Having a little difficulty with a REXX command LMOPEN

2023-02-06 Thread Paul Gilmartin
On Mon, 6 Feb 2023 15:29:01 +, Seymour J Metz  wrote:

>It follows TSO command conventions, so in that sense it is a TSO command, but 
>it is in an ISPF library.
>
So 'ADDRESS TSO  "ISPQRY"' fails if ISPF libraries are not allocated?

Did you mean trimodal?

By "bimodal" I meant ISPF vs. non-ISPF.  There are numerous modes.  I start 
some scripts with:
ADDRESS ISREDIT MACRO X
IF RC<>0 THEN PARSE ARG X

I feel that ISPF designers show contempt for REXX in eschewing REXX facilitird 
such as
PARSE ARG, and especially compound symbols.


From: Paul Gilmartin 
Sent: Monday, February 6, 2023 9:53 AM

On Mon, 6 Feb 2023 04:48:09 +, Seymour J Metz wrote:

>I would probably use ISPQRY, but your usage is shorter.
>
But does that require TSO?  I wanted to be TSO-independent:

z/OS 2.5  ISPF Services Guide
IBM   SC19-3626-50

Under TSO/E REXX that uses ADDRESS TSO you can use:
"ISPQRY"

(if it's a TSO command, shouldn't it be documented in the TSO COmmanf Ref.?)


From: Paul Gilmartin
Sent: Sunday, February 5, 2023 9:02 PM
>...
Thrtr are scripts intended to be bimodal where I have dome:
ADDRESS ISPEXEC DISPLAY 'MSG(ISRZ002)'
IF RC<>0 THEN DO  /* ISPF not active.  */
  say errMsg1
  say errMsg2;  END

--
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Having a little difficulty with a REXX command LMOPEN

2023-02-06 Thread Seymour J Metz
It follows TSO command conventions, so in that sense it is a TSO command, but 
it is in an ISPF library.

Did you mean trimodal?


From: IBM Mainframe Discussion List  on behalf of 
Paul Gilmartin <042bfe9c879d-dmarc-requ...@listserv.ua.edu>
Sent: Monday, February 6, 2023 9:53 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Having a little difficulty with a REXX command LMOPEN

On Mon, 6 Feb 2023 04:48:09 +, Seymour J Metz  wrote:

>I would probably use ISPQRY, but your usage is shorter.
>
But does that require TSO?  I wanted to be TSO-independent:

z/OS 2.5  ISPF Services Guide
IBM   SC19-3626-50

Under TSO/E REXX that uses ADDRESS TSO you can use:
"ISPQRY"

(if it's a TSO command, shouldn't it be documented in the TSO COmmanf Ref.?)


From: Paul Gilmartin
Sent: Sunday, February 5, 2023 9:02 PM
>...
Thrtr are scripts intended to be bimodal where I have dome:
ADDRESS ISPEXEC DISPLAY 'MSG(ISRZ002)'
IF RC<>0 THEN DO  /* ISPF not active.  */
  say errMsg1
  say errMsg2;  END

--
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Having a little difficulty with a REXX command LMOPEN

2023-02-06 Thread Lionel B. Dyck
Or use sysvar('sysispf') - either ACTIVE or NOT ACTIVE.


Lionel B. Dyck <><
Website: https://www.lbdsoftware.com
Github: https://github.com/lbdyck

“Worry more about your character than your reputation. Character is what you 
are, reputation merely what others think you are.”   - - - John Wooden

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of 
Paul Gilmartin
Sent: Monday, February 6, 2023 8:54 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Having a little difficulty with a REXX command LMOPEN

On Mon, 6 Feb 2023 04:48:09 +, Seymour J Metz  wrote:

>I would probably use ISPQRY, but your usage is shorter.
>
But does that require TSO?  I wanted to be TSO-independent:

z/OS 2.5  ISPF Services Guide
IBM   SC19-3626-50

Under TSO/E REXX that uses ADDRESS TSO you can use:
"ISPQRY"

(if it's a TSO command, shouldn't it be documented in the TSO COmmanf Ref.?)


From: Paul Gilmartin
Sent: Sunday, February 5, 2023 9:02 PM
>...
Thrtr are scripts intended to be bimodal where I have dome:
ADDRESS ISPEXEC DISPLAY 'MSG(ISRZ002)'
IF RC<>0 THEN DO  /* ISPF not active.  */
  say errMsg1
  say errMsg2;  END

--
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Having a little difficulty with a REXX command LMOPEN

2023-02-06 Thread Paul Gilmartin
On Mon, 6 Feb 2023 04:48:09 +, Seymour J Metz  wrote:

>I would probably use ISPQRY, but your usage is shorter.
>
But does that require TSO?  I wanted to be TSO-independent:

z/OS 2.5  ISPF Services Guide
IBM   SC19-3626-50

Under TSO/E REXX that uses ADDRESS TSO you can use:
"ISPQRY"

(if it's a TSO command, shouldn't it be documented in the TSO COmmanf Ref.?)


From: Paul Gilmartin 
Sent: Sunday, February 5, 2023 9:02 PM
>...
Thrtr are scripts intended to be bimodal where I have dome:
ADDRESS ISPEXEC DISPLAY 'MSG(ISRZ002)'
IF RC<>0 THEN DO  /* ISPF not active.  */
  say errMsg1
  say errMsg2;  END

-- 
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Having a little difficulty with a REXX command LMOPEN

2023-02-05 Thread Seymour J Metz
I would probably use ISPQRY, but your usage is shorter.


From: IBM Mainframe Discussion List  on behalf of 
Paul Gilmartin <042bfe9c879d-dmarc-requ...@listserv.ua.edu>
Sent: Sunday, February 5, 2023 9:02 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Having a little difficulty with a REXX command LMOPEN

On Mon, 6 Feb 2023 01:33:47 +, Seymour J Metz wrote:

>Are you sure you want to use say rather than, e.g., ADDRESS ISPEXEC DISPLAY 
>'MSG(ISRZ002)'?
>
Thrtr are scripts intended to be bimodal where I have dome:
ADDRESS ISPEXEC DISPLAY 'MSG(ISRZ002)'
IF RC<>0 THEN DO  /* ISPF not active.  */
  say errMsg1
  say errMsg2;  END

--
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Having a little difficulty with a REXX command LMOPEN

2023-02-05 Thread Paul Gilmartin
On Mon, 6 Feb 2023 01:33:47 +, Seymour J Metz wrote:

>Are you sure you want to use say rather than, e.g., ADDRESS ISPEXEC DISPLAY 
>'MSG(ISRZ002)'?
>
Thrtr are scripts intended to be bimodal where I have dome:
ADDRESS ISPEXEC DISPLAY 'MSG(ISRZ002)'
IF RC<>0 THEN DO  /* ISPF not active.  */
  say errMsg1
  say errMsg2;  END

-- 
gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Having a little difficulty with a REXX command LMOPEN

2023-02-05 Thread Seymour J Metz
Are you sure you want to use say rather than, e.g., ADDRESS ISPEXEC DISPLAY 
'MSG(ISRZ002)'?


From: IBM Mainframe Discussion List  on behalf of 
Cameron Conacher <03cfc59146bb-dmarc-requ...@listserv.ua.edu>
Sent: Sunday, February 5, 2023 4:59 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Having a little difficulty with a REXX command LMOPEN

Here is my DO/END Loop.
I am copying members from a previous Backup Library, back into my execution 
Library, using an input list to derive a MEMBER Name (I have named this string 
variable rComp.)
I do an LMINIT of the backup Library
And then I do an LMOPEN of the backup Library
I do an LMINIT of the target execution Library

The I do an LMMLIST to find my backup Library Member named rComp
If the LMMLIST fails (can’t find the Member name in my Backup Library) I write 
an error message and issue an ITERATE.
Before issuing the ITERATE, I SHOULD have included code for the LMMLIST 
option(free), LMCLOSE and LMFREE.
Normally, I do these things, just before the END of the DO/END block. But, 
ITERATE takes me out of the loop and starts again at the top.

Also, one should “normally” check the return code from an LMOPEN.
My stumbling block was that I could see in the trace output, that the LMOPEN 
failed with a RC=8, and I did not know why it really failed.

Do ip = 1 to icomp.0
   /* Parse record to various fields */
   rNlib = strip(substr(icomp.ip, 69, 44))
   rNbkp = strip(substr(icomp.ip, 114, 44))
   rComp = strip(substr(icomp.ip, 1, 8))
   rCont = strip(substr(icomp.ip, 14, 10))
   rPath = strip(substr(icomp.ip, 21, 2))
   rptRsn = '!!! Component not moved !!!'
   /* Fully qualified DSN names with quotes */
   fqNbkp = "'"||rNbkp||"'"
   fqNlib = "'"||rNlib||"'"

   /* LMINIT the from & to PDS */
   Address ISPEXEC
   "LMINIT DATAID(Nbkp) DATASET("fqNbkp") ENQ(shrw)"
   If rc /= 0 Then Do
  errMsg1 = ' Unable to access Production PDS. Check if the library
  errMsg2 = ' 'fqNbkp' exists/Contact Programmer. RC for LMINIT 'rc
  exRC = rc
  signal evac
   End

   "LMOPEN Dataid("Nbkp")"

   "LMINIT DATAID(Nlib) DATASET("fqNlib") ENQ(shrw)"
   If rc > 0 Then Do
  errMsg1 = ' Unable to access Production PDS. Check if the library
  errMsg2 = ' 'fqNlib' exists/Contact Programmer. '
  exRC = rc
  signal evac
   End

   eoPDS = 'N'
   "LMMLIST Dataid("Nbkp") OPTION(LIST) STATS(NO)",
   "MEMBER(rComp)"
   If rc >= 4 Then Do
  errMsg1 = ' Member 'rComp' not found in Backup library.'
  errMsg2 = ' Data was not replaced.'
  say errMsg1
  say errMsg2
  /*  This is where my error is. I need to do the LMCLOSE/LMFREE work here, 
before I ITERATE. */

  Iterate

  /*  signal evac */
   End

   Else Do
  replFl = 'REPLACE'
  "LMMOVE FROMID("Nbkp") TODATAID("Nlib")",
  "FROMMEM("rComp") "replFl
  If rc /= 0 Then Do
 errMsg1 = "LMMOVE error for "rComp
 errMsg2 = "Return code was "rc
 exRC = rc
 signal evac
  End
  Else Do
 rptRsn = 'Move from N-Backup library complete'
  End
   End

   call buildrpt

   "LMMLIST Dataid("Nbkp") OPTION(free)"
   "LMCLOSE Dataid("Nlib")"
   "LMFREE Dataid("Nbkp")"
   "LMFREE Dataid("Nlib")"
End

Thanks

…….Cameron

From: IBM Mainframe Discussion List  On Behalf Of 
Hobart Spitz
Sent: Sunday, February 5, 2023 4:41 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: [External] Re: Having a little difficulty with a REXX command LMOPEN

I have a few thoughts. I still have to guess because you didn't include
all of the relevant code, and your colors didn't come through.

- Are you missing "LMCLOSE Dataid("Nbkp")". This might cause an
exhaustion of LMOPEN resources. It would be my guess for the best
candidate solution.
- Adding TRACE COM, temporarily, might give you (and us) more
information. Please send the last screen or two of trace output, including
the terminating error message (s).
- As you know, zerrsm and zerrlm give crucial information. Please share
those values.
- It might be worth looking into your log (option 7.5); you must turn on
the ISPF log. (I pity the genius who does anything with ISPEXEC/ISREDIT
commands but doesn't have their log turned on.)
- It's not clear, but you might have been using SIGNAL EVAC as a GO TO.
It is not! This form of SIGNAL unwinds any structures within the current
procedure before transferring control. Any active DO loops are removed!
This might be the reason it appeared that SIGNAL EVAC causes a
problem, when everything was working as designed. LEAVE might be what you
need. It ends an inner loop, but lets an outer one continue.
- I have never heard of a &q

Re: Having a little difficulty with a REXX command LMOPEN

2023-02-05 Thread Cameron Conacher
Nice.
Thank you.

Sent from my iPhone

> On Feb 5, 2023, at 5:12 PM, Lionel B. Dyck  wrote:
> 
> If you want a tool to copy members from one library to another based on 
> differences, then check out my ZSYNC tool. It can compare two PDS/PDSE 
> libraries (doesn't understand member generations using either ISPF Statistics 
> or member contents.
> 
> You can find it at https://github.com/lbdyck/zsync or file 314 at 
> www.cbttape.org
> 
> 
> Lionel B. Dyck <><
> Website: https://www.lbdsoftware.com
> Github: https://github.com/lbdyck
> 
> “Worry more about your character than your reputation. Character is what you 
> are, reputation merely what others think you are.”   - - - John Wooden
> 
> -Original Message-
> From: IBM Mainframe Discussion List  On Behalf Of 
> Cameron Conacher
> Sent: Sunday, February 5, 2023 3:59 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: Having a little difficulty with a REXX command LMOPEN
> 
> Here is my DO/END Loop.
> I am copying members from a previous Backup Library, back into my execution 
> Library, using an input list to derive a MEMBER Name (I have named this 
> string variable rComp.) I do an LMINIT of the backup Library And then I do an 
> LMOPEN of the backup Library I do an LMINIT of the target execution Library
> 
> The I do an LMMLIST to find my backup Library Member named rComp If the 
> LMMLIST fails (can’t find the Member name in my Backup Library) I write an 
> error message and issue an ITERATE.
> Before issuing the ITERATE, I SHOULD have included code for the LMMLIST 
> option(free), LMCLOSE and LMFREE.
> Normally, I do these things, just before the END of the DO/END block. But, 
> ITERATE takes me out of the loop and starts again at the top.
> 
> Also, one should “normally” check the return code from an LMOPEN.
> My stumbling block was that I could see in the trace output, that the LMOPEN 
> failed with a RC=8, and I did not know why it really failed.
> 
> Do ip = 1 to icomp.0
>   /* Parse record to various fields */
>   rNlib = strip(substr(icomp.ip, 69, 44))
>   rNbkp = strip(substr(icomp.ip, 114, 44))
>   rComp = strip(substr(icomp.ip, 1, 8))
>   rCont = strip(substr(icomp.ip, 14, 10))
>   rPath = strip(substr(icomp.ip, 21, 2))
>   rptRsn = '!!! Component not moved !!!'
>   /* Fully qualified DSN names with quotes */
>   fqNbkp = "'"||rNbkp||"'"
>   fqNlib = "'"||rNlib||"'"
> 
>   /* LMINIT the from & to PDS */
>   Address ISPEXEC
>   "LMINIT DATAID(Nbkp) DATASET("fqNbkp") ENQ(shrw)"
>   If rc /= 0 Then Do
>  errMsg1 = ' Unable to access Production PDS. Check if the library
>  errMsg2 = ' 'fqNbkp' exists/Contact Programmer. RC for LMINIT 'rc
>  exRC = rc
>  signal evac
>   End
> 
>   "LMOPEN Dataid("Nbkp")"
> 
>   "LMINIT DATAID(Nlib) DATASET("fqNlib") ENQ(shrw)"
>   If rc > 0 Then Do
>  errMsg1 = ' Unable to access Production PDS. Check if the library
>  errMsg2 = ' 'fqNlib' exists/Contact Programmer. '
>  exRC = rc
>  signal evac
>   End
> 
>   eoPDS = 'N'
>   "LMMLIST Dataid("Nbkp") OPTION(LIST) STATS(NO)",
>   "MEMBER(rComp)"
>   If rc >= 4 Then Do
>  errMsg1 = ' Member 'rComp' not found in Backup library.'
>  errMsg2 = ' Data was not replaced.'
>  say errMsg1
>  say errMsg2
>  /*  This is where my error is. I need to do the LMCLOSE/LMFREE work here, 
> before I ITERATE. */
> 
>  Iterate
> 
>  /*  signal evac */
>   End
> 
>   Else Do
>  replFl = 'REPLACE'
>  "LMMOVE FROMID("Nbkp") TODATAID("Nlib")",
>  "FROMMEM("rComp") "replFl
>  If rc /= 0 Then Do
> errMsg1 = "LMMOVE error for "rComp
> errMsg2 = "Return code was "rc
>     exRC = rc
> signal evac
>  End
>  Else Do
> rptRsn = 'Move from N-Backup library complete'
>  End
>   End
> 
>   call buildrpt
> 
>   "LMMLIST Dataid("Nbkp") OPTION(free)"
>   "LMCLOSE Dataid("Nlib")"
>   "LMFREE Dataid("Nbkp")"
>   "LMFREE Dataid("Nlib")"
> End
> 
> Thanks
> 
> …….Cameron
> 
> From: IBM Mainframe Discussion List  On Behalf Of 
> Hobart Spitz
> Sent: Sunday, February 5, 2023 4:41 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: [External] Re: Having a little difficulty with a REXX command LMOPEN
> 
> I have a few thoughts. I still have to guess because you didn't include all 
> of the relevant code, and your colors d

Re: Having a little difficulty with a REXX command LMOPEN

2023-02-05 Thread Lionel B. Dyck
If you want a tool to copy members from one library to another based on 
differences, then check out my ZSYNC tool. It can compare two PDS/PDSE 
libraries (doesn't understand member generations using either ISPF Statistics 
or member contents.

You can find it at https://github.com/lbdyck/zsync or file 314 at 
www.cbttape.org


Lionel B. Dyck <><
Website: https://www.lbdsoftware.com
Github: https://github.com/lbdyck

“Worry more about your character than your reputation. Character is what you 
are, reputation merely what others think you are.”   - - - John Wooden

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of 
Cameron Conacher
Sent: Sunday, February 5, 2023 3:59 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Having a little difficulty with a REXX command LMOPEN

Here is my DO/END Loop.
I am copying members from a previous Backup Library, back into my execution 
Library, using an input list to derive a MEMBER Name (I have named this string 
variable rComp.) I do an LMINIT of the backup Library And then I do an LMOPEN 
of the backup Library I do an LMINIT of the target execution Library

The I do an LMMLIST to find my backup Library Member named rComp If the LMMLIST 
fails (can’t find the Member name in my Backup Library) I write an error 
message and issue an ITERATE.
Before issuing the ITERATE, I SHOULD have included code for the LMMLIST 
option(free), LMCLOSE and LMFREE.
Normally, I do these things, just before the END of the DO/END block. But, 
ITERATE takes me out of the loop and starts again at the top.

Also, one should “normally” check the return code from an LMOPEN.
My stumbling block was that I could see in the trace output, that the LMOPEN 
failed with a RC=8, and I did not know why it really failed.

Do ip = 1 to icomp.0
   /* Parse record to various fields */
   rNlib = strip(substr(icomp.ip, 69, 44))
   rNbkp = strip(substr(icomp.ip, 114, 44))
   rComp = strip(substr(icomp.ip, 1, 8))
   rCont = strip(substr(icomp.ip, 14, 10))
   rPath = strip(substr(icomp.ip, 21, 2))
   rptRsn = '!!! Component not moved !!!'
   /* Fully qualified DSN names with quotes */
   fqNbkp = "'"||rNbkp||"'"
   fqNlib = "'"||rNlib||"'"

   /* LMINIT the from & to PDS */
   Address ISPEXEC
   "LMINIT DATAID(Nbkp) DATASET("fqNbkp") ENQ(shrw)"
   If rc /= 0 Then Do
  errMsg1 = ' Unable to access Production PDS. Check if the library
  errMsg2 = ' 'fqNbkp' exists/Contact Programmer. RC for LMINIT 'rc
  exRC = rc
  signal evac
   End

   "LMOPEN Dataid("Nbkp")"

   "LMINIT DATAID(Nlib) DATASET("fqNlib") ENQ(shrw)"
   If rc > 0 Then Do
  errMsg1 = ' Unable to access Production PDS. Check if the library
  errMsg2 = ' 'fqNlib' exists/Contact Programmer. '
  exRC = rc
  signal evac
   End

   eoPDS = 'N'
   "LMMLIST Dataid("Nbkp") OPTION(LIST) STATS(NO)",
   "MEMBER(rComp)"
   If rc >= 4 Then Do
  errMsg1 = ' Member 'rComp' not found in Backup library.'
  errMsg2 = ' Data was not replaced.'
  say errMsg1
  say errMsg2
  /*  This is where my error is. I need to do the LMCLOSE/LMFREE work here, 
before I ITERATE. */

  Iterate

  /*  signal evac */
   End

   Else Do
  replFl = 'REPLACE'
  "LMMOVE FROMID("Nbkp") TODATAID("Nlib")",
  "FROMMEM("rComp") "replFl
  If rc /= 0 Then Do
 errMsg1 = "LMMOVE error for "rComp
 errMsg2 = "Return code was "rc
 exRC = rc
 signal evac
  End
  Else Do
 rptRsn = 'Move from N-Backup library complete'
  End
   End

   call buildrpt

   "LMMLIST Dataid("Nbkp") OPTION(free)"
   "LMCLOSE Dataid("Nlib")"
   "LMFREE Dataid("Nbkp")"
   "LMFREE Dataid("Nlib")"
End

Thanks

…….Cameron

From: IBM Mainframe Discussion List  On Behalf Of 
Hobart Spitz
Sent: Sunday, February 5, 2023 4:41 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: [External] Re: Having a little difficulty with a REXX command LMOPEN

I have a few thoughts. I still have to guess because you didn't include all of 
the relevant code, and your colors didn't come through.

- Are you missing "LMCLOSE Dataid("Nbkp")". This might cause an exhaustion of 
LMOPEN resources. It would be my guess for the best candidate solution.
- Adding TRACE COM, temporarily, might give you (and us) more information. 
Please send the last screen or two of trace output, including the terminating 
error message (s).
- As you know, zerrsm and zerrlm give crucial information. Please share those 
values.
- It might be worth looking into your log (option 7.5); you must turn on the 
ISPF log. (I pity the genius who does anything with ISPEXEC/ISREDIT commands 
but doesn't have their log turned on.)
- It's not clear, 

Re: Having a little difficulty with a REXX command LMOPEN

2023-02-05 Thread Cameron Conacher
Here is my DO/END Loop.
I am copying members from a previous Backup Library, back into my execution 
Library, using an input list to derive a MEMBER Name (I have named this string 
variable rComp.)
I do an LMINIT of the backup Library
And then I do an LMOPEN of the backup Library
I do an LMINIT of the target execution Library

The I do an LMMLIST to find my backup Library Member named rComp
If the LMMLIST fails (can’t find the Member name in my Backup Library) I write 
an error message and issue an ITERATE.
Before issuing the ITERATE, I SHOULD have included code for the LMMLIST 
option(free), LMCLOSE and LMFREE.
Normally, I do these things, just before the END of the DO/END block. But, 
ITERATE takes me out of the loop and starts again at the top.

Also, one should “normally” check the return code from an LMOPEN.
My stumbling block was that I could see in the trace output, that the LMOPEN 
failed with a RC=8, and I did not know why it really failed.

Do ip = 1 to icomp.0
   /* Parse record to various fields */
   rNlib = strip(substr(icomp.ip, 69, 44))
   rNbkp = strip(substr(icomp.ip, 114, 44))
   rComp = strip(substr(icomp.ip, 1, 8))
   rCont = strip(substr(icomp.ip, 14, 10))
   rPath = strip(substr(icomp.ip, 21, 2))
   rptRsn = '!!! Component not moved !!!'
   /* Fully qualified DSN names with quotes */
   fqNbkp = "'"||rNbkp||"'"
   fqNlib = "'"||rNlib||"'"

   /* LMINIT the from & to PDS */
   Address ISPEXEC
   "LMINIT DATAID(Nbkp) DATASET("fqNbkp") ENQ(shrw)"
   If rc /= 0 Then Do
  errMsg1 = ' Unable to access Production PDS. Check if the library
  errMsg2 = ' 'fqNbkp' exists/Contact Programmer. RC for LMINIT 'rc
  exRC = rc
  signal evac
   End

   "LMOPEN Dataid("Nbkp")"

   "LMINIT DATAID(Nlib) DATASET("fqNlib") ENQ(shrw)"
   If rc > 0 Then Do
  errMsg1 = ' Unable to access Production PDS. Check if the library
  errMsg2 = ' 'fqNlib' exists/Contact Programmer. '
  exRC = rc
  signal evac
   End

   eoPDS = 'N'
   "LMMLIST Dataid("Nbkp") OPTION(LIST) STATS(NO)",
   "MEMBER(rComp)"
   If rc >= 4 Then Do
  errMsg1 = ' Member 'rComp' not found in Backup library.'
  errMsg2 = ' Data was not replaced.'
  say errMsg1
  say errMsg2
  /*  This is where my error is. I need to do the LMCLOSE/LMFREE work here, 
before I ITERATE. */

  Iterate

  /*  signal evac */
   End

   Else Do
  replFl = 'REPLACE'
  "LMMOVE FROMID("Nbkp") TODATAID("Nlib")",
  "FROMMEM("rComp") "replFl
  If rc /= 0 Then Do
 errMsg1 = "LMMOVE error for "rComp
 errMsg2 = "Return code was "rc
 exRC = rc
 signal evac
  End
  Else Do
 rptRsn = 'Move from N-Backup library complete'
  End
   End

   call buildrpt

   "LMMLIST Dataid("Nbkp") OPTION(free)"
   "LMCLOSE Dataid("Nlib")"
   "LMFREE Dataid("Nbkp")"
   "LMFREE Dataid("Nlib")"
End

Thanks

…….Cameron

From: IBM Mainframe Discussion List  On Behalf Of 
Hobart Spitz
Sent: Sunday, February 5, 2023 4:41 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: [External] Re: Having a little difficulty with a REXX command LMOPEN

I have a few thoughts. I still have to guess because you didn't include
all of the relevant code, and your colors didn't come through.

- Are you missing "LMCLOSE Dataid("Nbkp")". This might cause an
exhaustion of LMOPEN resources. It would be my guess for the best
candidate solution.
- Adding TRACE COM, temporarily, might give you (and us) more
information. Please send the last screen or two of trace output, including
the terminating error message (s).
- As you know, zerrsm and zerrlm give crucial information. Please share
those values.
- It might be worth looking into your log (option 7.5); you must turn on
the ISPF log. (I pity the genius who does anything with ISPEXEC/ISREDIT
commands but doesn't have their log turned on.)
- It's not clear, but you might have been using SIGNAL EVAC as a GO TO.
It is not! This form of SIGNAL unwinds any structures within the current
procedure before transferring control. Any active DO loops are removed!
This might be the reason it appeared that SIGNAL EVAC causes a
problem, when everything was working as designed. LEAVE might be what you
need. It ends an inner loop, but lets an outer one continue.
- I have never heard of a "VSAM library", but you may be referring to
something other than what I'm interpreting the comment to mean.

Other than those, I think you have most of the elements correct and in
place, so I think you are close.

OREXXMan
Q: What do you call the residence of the ungulate with the largest antlers?
A: A moose pad.
:-D
Would you rather pass data in move mode (*nix piping) o

Re: Having a little difficulty with a REXX command LMOPEN

2023-02-05 Thread Hobart Spitz
I have a few thoughts.  I still have to guess because you didn't include
all of the relevant code, and your colors didn't come through.

   - Are you missing "LMCLOSE Dataid("Nbkp")".  This might cause an
   exhaustion of LMOPEN resources.  It would be my guess for the best
   candidate solution.
   - Adding TRACE COM, temporarily, might give you (and us) more
   information.  Please send the last screen or two of trace output, including
   the terminating error message (s).
   - As you know, zerrsm and zerrlm give crucial information.  Please share
   those values.
   - It might be worth looking into your log (option 7.5); you must turn on
   the ISPF log.  (I pity the genius who does anything with ISPEXEC/ISREDIT
   commands but doesn't have their log turned on.)
   - It's not clear, but you might have been using SIGNAL EVAC as a GO TO.
   It is not!  This form of SIGNAL unwinds any structures within the current
   procedure before transferring control.  Any active DO loops are removed!
   This might be the reason it appeared that SIGNAL EVAC causes a
   problem, when everything was working as designed.  LEAVE might be what you
   need.  It ends an inner loop, but lets an outer one continue.
   - I have never heard of a "VSAM library", but you may be referring to
   something other than what I'm interpreting the comment to mean.

Other than those, I think you have most of the elements correct and in
place, so I think you are close.

OREXXMan
Q: What do you call the residence of the ungulate with the largest antlers?
A: A moose pad.
:-D
Would you rather pass data in move mode (*nix piping) or locate mode
(Pipes) or via disk (JCL)?  Why do you think you rarely see *nix commands
with more than a dozen filters, while Pipelines specifications are commonly
over 100s of stages, and 1000s of stages are not uncommon.
REXX is the new C.


On Sun, Feb 5, 2023 at 2:53 PM Cameron Conacher <
03cfc59146bb-dmarc-requ...@listserv.ua.edu> wrote:

> Yep, I am doing LMFREE and LMCLOSE, but I had introduced an error when I
> included an INTERATE command in the middle of a DO/END and so in a specific
> situation, the LMFREE/LMCLOSE would not get executed.
> And then in the subsequent iteration, I would see the LMOPEN error.
>
> I got a return code of 8, but did not see any additional information and I
> completely forgot (old age?) I should be dumping out zerrsm and zerrlm.
> I should ALWAYS execute the REXX statements in green, but when I arrive in
> the yellow code, I skip over the LMFEE/LMCLOSE which causes grief with the
> subsequent iterations.
>
>
>/* Copy all members from VSAM library. No exceptions here */
>"LMMLIST Dataid("Nbkp") OPTION(LIST) STATS(NO)",
>"MEMBER(rComp)"
>If rc >= 4 Then Do
>   errMsg1 = ' Member 'rComp' not found in Backup library.'
>   errMsg2 = ' Data was not replaced.'
>   say errMsg1
>   say errMsg2
>   Iterate* This causes an issue for subsequent
> iterations of the DO/END
>   /*  signal evac */
>End
>Else Do
>   replFl = 'REPLACE'
>   "LMMOVE FROMID("Nbkp") TODATAID("Nlib")",
>   "FROMMEM("rComp") "replFl
>   If rc /= 0 Then Do
>  errMsg1 = "LMMOVE error for "rComp
>  errMsg2 = "Return code was "rc
>  exRC = rc
>  signal evac
>   End
>   Else Do
>  rptRsn = 'Move from N-Backup library complete'
>   End
>End
>call buildrpt
>"LMMLIST Dataid("Nbkp") OPTION(free)"
>"LMCLOSE Dataid("Nlib")"
>    "LMFREE Dataid("Nbkp")"
>"LMFREE Dataid("Nlib")"
> End
>
>
>
> Thanks
>
> …….Cameron
>
> From: IBM Mainframe Discussion List  On Behalf
> Of Hobart Spitz
> Sent: Sunday, February 5, 2023 1:56 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: [External] Re: Having a little difficulty with a REXX command
> LMOPEN
>
> Are you doing LMFREE, on the dataid from LMINIT, when you are finished with
> each library?
> It sounds like you are exceeding resources for LMINITs.
>
> I don't think FREE/CLOSE is needed. LMINIT and LMFREE are faster, more
> reliable and easier to use.
>
> It also sounds like you are not getting the return code back so you can
> display zerrsm and zerrlm. (Unless you did this and I missed it.) You may
> need to issue SIGNAL OFF ERROR, and/or ADDRESS ISPEXEC "CONTROL ERRORS
> RETURN". Otherwise your program won't be able to report what happened.
>
> Please study and understand Lionell's example. Your outer (library) loop
> should include all of those elements.
>
> We still need to see your code 

Re: Having a little difficulty with a REXX command LMOPEN

2023-02-05 Thread Cameron Conacher
Yep, I am doing LMFREE and LMCLOSE, but I had introduced an error when I 
included an INTERATE command in the middle of a DO/END and so in a specific 
situation, the LMFREE/LMCLOSE would not get executed.
And then in the subsequent iteration, I would see the LMOPEN error.

I got a return code of 8, but did not see any additional information and I 
completely forgot (old age?) I should be dumping out zerrsm and zerrlm.
I should ALWAYS execute the REXX statements in green, but when I arrive in the 
yellow code, I skip over the LMFEE/LMCLOSE which causes grief with the 
subsequent iterations.


   /* Copy all members from VSAM library. No exceptions here */
   "LMMLIST Dataid("Nbkp") OPTION(LIST) STATS(NO)",
   "MEMBER(rComp)"
   If rc >= 4 Then Do
  errMsg1 = ' Member 'rComp' not found in Backup library.'
  errMsg2 = ' Data was not replaced.'
  say errMsg1
  say errMsg2
  Iterate* This causes an issue for subsequent iterations 
of the DO/END
  /*  signal evac */
   End
   Else Do
  replFl = 'REPLACE'
  "LMMOVE FROMID("Nbkp") TODATAID("Nlib")",
  "FROMMEM("rComp") "replFl
  If rc /= 0 Then Do
 errMsg1 = "LMMOVE error for "rComp
 errMsg2 = "Return code was "rc
 exRC = rc
 signal evac
  End
  Else Do
 rptRsn = 'Move from N-Backup library complete'
  End
   End
   call buildrpt
   "LMMLIST Dataid("Nbkp") OPTION(free)"
   "LMCLOSE Dataid("Nlib")"
   "LMFREE Dataid("Nbkp")"
   "LMFREE Dataid("Nlib")"
End



Thanks

…….Cameron

From: IBM Mainframe Discussion List  On Behalf Of 
Hobart Spitz
Sent: Sunday, February 5, 2023 1:56 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: [External] Re: Having a little difficulty with a REXX command LMOPEN

Are you doing LMFREE, on the dataid from LMINIT, when you are finished with
each library?
It sounds like you are exceeding resources for LMINITs.

I don't think FREE/CLOSE is needed. LMINIT and LMFREE are faster, more
reliable and easier to use.

It also sounds like you are not getting the return code back so you can
display zerrsm and zerrlm. (Unless you did this and I missed it.) You may
need to issue SIGNAL OFF ERROR, and/or ADDRESS ISPEXEC "CONTROL ERRORS
RETURN". Otherwise your program won't be able to report what happened.

Please study and understand Lionell's example. Your outer (library) loop
should include all of those elements.

We still need to see your code as written; I'm just guessing from your
description. There could be something you are doing that I have not
considered.


OREXXMan
Q: What do you call the residence of the ungulate with the largest antlers?
A: A moose pad.
:-D
Would you rather pass data in move mode (*nix piping) or locate mode
(Pipes) or via disk (JCL)? Why do you think you rarely see *nix commands
with more than a dozen filters, while Pipelines specifications are commonly
over 100s of stages, and 1000s of stages are not uncommon.
REXX is the new C.


On Sun, Feb 5, 2023 at 11:51 AM Cameron Conacher <
03cfc59146bb-dmarc-requ...@listserv.ua.edu<mailto:03cfc59146bb-dmarc-requ...@listserv.ua.edu>>
 wrote:

> Thanks a ton everyone.
> Just a dumb User issue here (me).
>
> I have a DO loop, and at the bottom of the loop I manage the cleanup
> (FREE/CLOSE)
> However, inside the loop I had some code where I would report an
> encountered error, and then issue ITERATE to work with the next input
> library member.
> In this situation I never actually got to the bottom of the Loop and I
> never issued the FREE/CLOSE.
> The next time I tried an LMOPEN on the same library, it failed.
>
> Appreciate the helpful information.
> I did not remember I could dump the zerrsm and zerrlm to get additional
> information.
>
> Thanks
>
> ...Cameron
>
> From: IBM Mainframe Discussion List 
> mailto:IBM-MAIN@LISTSERV.UA.EDU>> On Behalf
> Of Lionel B. Dyck
> Sent: Friday, February 3, 2023 8:39 AM
> To: IBM-MAIN@LISTSERV.UA.EDU<mailto:IBM-MAIN@LISTSERV.UA.EDU>
> Subject: [External] Re: Having a little difficulty with a REXX command
> LMOPEN
>
> Here is a sample that I wrote awhile ago to better understand how lmcopy
> works - hope this helps - no lmopen required.
>
> /* --- REXX --- *
> * test code for lmcopy *
> *  */
> in = 'hlq.test.pds'
> out = 'hlq.test.pdse'
> Address ISPexec
> "lminit dataid(indd1) dataset('"in"')"
> "lminit dataid(outdd1) dataset('"out"')"
> "lmcopy fromid("indd1") todataid("outdd1")" ,
> "frommem(a*) replace"
> "lmcopy fromid("indd1") todataid("outdd1")" ,
> &q

Re: Having a little difficulty with a REXX command LMOPEN

2023-02-05 Thread Hobart Spitz
Are you doing LMFREE, on the dataid from LMINIT, when you are finished with
each library?
It sounds like you are exceeding resources for LMINITs.

I don't think FREE/CLOSE is needed.  LMINIT and LMFREE are faster, more
reliable and easier to use.

It also sounds like you are not getting the return code back so you can
display zerrsm and zerrlm.  (Unless you did this and I missed it.)  You may
need to issue SIGNAL OFF ERROR, and/or ADDRESS ISPEXEC "CONTROL ERRORS
RETURN".  Otherwise your program won't be able to report what happened.

Please study and understand Lionell's example.  Your outer (library) loop
should include all of those elements.

We still need to see your code as written; I'm just guessing from your
description.  There could be something you are doing that I have not
considered.


OREXXMan
Q: What do you call the residence of the ungulate with the largest antlers?
A: A moose pad.
:-D
Would you rather pass data in move mode (*nix piping) or locate mode
(Pipes) or via disk (JCL)?  Why do you think you rarely see *nix commands
with more than a dozen filters, while Pipelines specifications are commonly
over 100s of stages, and 1000s of stages are not uncommon.
REXX is the new C.


On Sun, Feb 5, 2023 at 11:51 AM Cameron Conacher <
03cfc59146bb-dmarc-requ...@listserv.ua.edu> wrote:

> Thanks a ton everyone.
> Just a dumb User issue here (me).
>
> I have a DO loop, and at the bottom of the loop I manage the cleanup
> (FREE/CLOSE)
> However, inside the loop I had some code where I would report an
> encountered error, and then issue ITERATE to work with the next input
> library member.
> In this situation I never actually got to the bottom of the Loop and I
> never issued the FREE/CLOSE.
> The next time I tried an LMOPEN on the same library, it failed.
>
> Appreciate the helpful information.
> I did not remember I could dump the zerrsm and zerrlm to get additional
> information.
>
> Thanks
>
> ...Cameron
>
> From: IBM Mainframe Discussion List  On Behalf
> Of Lionel B. Dyck
> Sent: Friday, February 3, 2023 8:39 AM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: [External] Re: Having a little difficulty with a REXX command
> LMOPEN
>
> Here is a sample that I wrote awhile ago to better understand how lmcopy
> works - hope this helps - no lmopen required.
>
> /* --- REXX --- *
> * test code for lmcopy *
> *  */
> in = 'hlq.test.pds'
> out = 'hlq.test.pdse'
> Address ISPexec
> "lminit dataid(indd1) dataset('"in"')"
> "lminit dataid(outdd1) dataset('"out"')"
> "lmcopy fromid("indd1") todataid("outdd1")" ,
> "frommem(a*) replace"
> "lmcopy fromid("indd1") todataid("outdd1")" ,
> "frommem(b*) replace"
> "lmfree dataid("indd1")"
> "lmfree dataid("outdd1")"
>
>
> Lionel B. Dyck <><
> Website: https://www.lbdsoftware.com<
> https://isolate.menlosecurity.com/1/3735928037/https:/www.lbdsoftware.com>
> Github: https://github.com/lbdyck<
> https://isolate.menlosecurity.com/1/3735928037/https:/github.com/lbdyck>
>
> "Worry more about your character than your reputation. Character is what
> you
> are, reputation merely what others think you are."   - - - John Wooden
>
> -Original Message-
> From: IBM Mainframe Discussion List  IBM-MAIN@LISTSERV.UA.EDU>> On Behalf Of
> Cameron Conacher
> Sent: Friday, February 3, 2023 7:19 AM
> To: IBM-MAIN@LISTSERV.UA.EDU<mailto:IBM-MAIN@LISTSERV.UA.EDU>
> Subject: Having a little difficulty with a REXX command LMOPEN
>
> Good Morning,
> I have a small REXX which essentially copies members of one PDSE to
> another.
>
> It iterates over members of the first PDSE and copies the members to the
> second PDSE.
>
> After about eighty members are copied, my LMOPEN fails with a return code
> of
> 8.
> I checked the manual and a return code of 8 from an LMOPEN means "The
> Dataset cannot be opened."
> 8
> Data set could not be opened.
>
>
> Is there somewhere I can see a bit more detail. Why the dataset could not
> be
> opened?
> I see nothing in the JES Log.
>
> Any thoughts appreciated.
>
> Thanks
>
>
> Cameron Conacher
> Senior Engineer
>
> American Express Canada Inc.
> GCICS
> 2225 Sheppard Avenue East, Toronto, ON M2J 5C2
>
> cameron.conac...@aexp.com<mailto:cameron.conac...@aexp.com> cameron.conac...@aexp.com<mailto:cameron.conac...@aexp.com>>
> Office: 1-437-836-5265
> Mobile: 1-416-409-5147
>
> https://amex.webex.com/join/cameron.conacher
>
> Note: I will be away from the office on PTO Friday Februar

Re: Having a little difficulty with a REXX command LMOPEN

2023-02-05 Thread Cameron Conacher
Thanks a ton everyone.
Just a dumb User issue here (me).

I have a DO loop, and at the bottom of the loop I manage the cleanup 
(FREE/CLOSE)
However, inside the loop I had some code where I would report an encountered 
error, and then issue ITERATE to work with the next input library member.
In this situation I never actually got to the bottom of the Loop and I never 
issued the FREE/CLOSE.
The next time I tried an LMOPEN on the same library, it failed.

Appreciate the helpful information.
I did not remember I could dump the zerrsm and zerrlm to get additional 
information.

Thanks

...Cameron

From: IBM Mainframe Discussion List  On Behalf Of 
Lionel B. Dyck
Sent: Friday, February 3, 2023 8:39 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: [External] Re: Having a little difficulty with a REXX command LMOPEN

Here is a sample that I wrote awhile ago to better understand how lmcopy
works - hope this helps - no lmopen required.

/* --- REXX --- *
* test code for lmcopy *
*  */
in = 'hlq.test.pds'
out = 'hlq.test.pdse'
Address ISPexec
"lminit dataid(indd1) dataset('"in"')"
"lminit dataid(outdd1) dataset('"out"')"
"lmcopy fromid("indd1") todataid("outdd1")" ,
"frommem(a*) replace"
"lmcopy fromid("indd1") todataid("outdd1")" ,
"frommem(b*) replace"
"lmfree dataid("indd1")"
"lmfree dataid("outdd1")"


Lionel B. Dyck <><
Website: 
https://www.lbdsoftware.com<https://isolate.menlosecurity.com/1/3735928037/https:/www.lbdsoftware.com>
Github: 
https://github.com/lbdyck<https://isolate.menlosecurity.com/1/3735928037/https:/github.com/lbdyck>

"Worry more about your character than your reputation. Character is what you
are, reputation merely what others think you are."   - - - John Wooden

-Original Message-
From: IBM Mainframe Discussion List 
mailto:IBM-MAIN@LISTSERV.UA.EDU>> On Behalf Of
Cameron Conacher
Sent: Friday, February 3, 2023 7:19 AM
To: IBM-MAIN@LISTSERV.UA.EDU<mailto:IBM-MAIN@LISTSERV.UA.EDU>
Subject: Having a little difficulty with a REXX command LMOPEN

Good Morning,
I have a small REXX which essentially copies members of one PDSE to another.

It iterates over members of the first PDSE and copies the members to the
second PDSE.

After about eighty members are copied, my LMOPEN fails with a return code of
8.
I checked the manual and a return code of 8 from an LMOPEN means "The
Dataset cannot be opened."
8
Data set could not be opened.


Is there somewhere I can see a bit more detail. Why the dataset could not be
opened?
I see nothing in the JES Log.

Any thoughts appreciated.

Thanks


Cameron Conacher
Senior Engineer

American Express Canada Inc.
GCICS
2225 Sheppard Avenue East, Toronto, ON M2J 5C2

cameron.conac...@aexp.com<mailto:cameron.conac...@aexp.com><mailto:cameron.conac...@aexp.com<mailto:cameron.conac...@aexp.com>>
Office: 1-437-836-5265
Mobile: 1-416-409-5147

https://amex.webex.com/join/cameron.conacher

Note: I will be away from the office on PTO Friday February 3, 2023


American Express made the following annotations
 This e-mail was sent to you by a
representative of Amex Bank of Canada, P.O. Box 3204, Station "F", Toronto,
ON, M1W 3W7, 
www.americanexpress.ca<https://isolate.menlosecurity.com/1/3735928037/http:/www.americanexpress.ca>.
 If you no longer wish to receive these
e-mails, please notify the sender by reply e-mail.

This e-mail is solely for the intended recipient and may contain
confidential or privileged information. If you are not the intended
recipient, any disclosure, copying, use, or distribution of the information
included in this e-mail is prohibited. If you have received this e-mail in
error, please notify the sender by reply e-mail and immediately and
permanently delete this e-mail and any attachments. Thank you.

American Express a fait les remarques suivantes Ce courriel vous a ?t?
envoy? par un repr?sentant de la Banque Amex du Canada, C.P. 3204,
succursale F, Toronto (Ontario) M1W 3W7, 
www.americanexpress.ca<https://isolate.menlosecurity.com/1/3735928037/http:/www.americanexpress.ca>.
 Si, par la
suite, vous ne souhaitez plus recevoir ces courriels, veuillez en aviser les
exp?diteurs par courriel.

Ce courriel est r?serv? au seul destinataire indiqu? et peut renfermer des
renseignements confidentiels et privil?gi?s. Si vous n'?tes pas le
destinataire pr?vu, toute divulgation, duplication, utilisation ou
distribution du courriel est interdite. Si vous avez re?u ce courriel par
erreur, veuillez en aviser l'exp?diteur par courriel et d?truire
imm?diatement le courriel et toute pi?ce jointe. Merci.

--
For IBM-MAIN subscribe / signoff / archive access 

Having a little difficulty with a REXX command LMOPEN

2023-02-03 Thread Hobart Spitz
When you get the error, display zerrsm and zerrlm.

We need to see your code.

I think Seymour is asking the right question.

On Fri, 3 Feb 2023, 07:19 Cameron Conacher, <03cfc59146bb-dmarc-
requ...@listserv.ua.edu> wrote:

> Good Morning,
> I have a small REXX which essentially copies members of one PDSE to
> another.
>
> It iterates over members of the first PDSE and copies the members to the
> second PDSE.
>
> After about eighty members are copied, my LMOPEN fails with a return code
> of 8.
> I checked the manual and a return code of 8 from an LMOPEN means "The
> Dataset cannot be opened."
>  8
> Data set could not be opened.
>
>
> Is there somewhere I can see a bit more detail. Why the dataset could not
> be opened?
> I see nothing in the JES Log.
>
> Any thoughts appreciated.
>
> Thanks
>
>
> Cameron Conacher
> Senior Engineer
>
> American Express Canada Inc.
> GCICS
> 2225 Sheppard Avenue East, Toronto, ON  M2J 5C2
>
> cameron.conac...@aexp.com
> Office: 1-437-836-5265
> Mobile: 1-416-409-5147
>
> https://amex.webex.com/join/cameron.conacher
>
> Note: I will be away from the office on PTO Friday February 3, 2023
>
> 
> American Express made the following annotations
> 
> This e-mail was sent to you by a representative of Amex Bank of Canada,
> P.O. Box 3204, Station "F", Toronto, ON, M1W 3W7, www.americanexpress.ca.
> If you no longer wish to receive these e-mails, please notify the sender by
> reply e-mail.
>
> This e-mail is solely for the intended recipient and may contain
> confidential or privileged information. If you are not the intended
> recipient, any disclosure, copying, use, or distribution of the information
> included in this e-mail is prohibited. If you have received this e-mail in
> error, please notify the sender by reply e-mail and immediately and
> permanently delete this e-mail and any attachments. Thank you.
>
> American Express a fait les remarques suivantes
> Ce courriel vous a ?t? envoy? par un repr?sentant de la Banque Amex du
> Canada, C.P. 3204, succursale F, Toronto (Ontario) M1W 3W7,
> www.americanexpress.ca. Si, par la suite, vous ne souhaitez plus recevoir
> ces courriels, veuillez en aviser les exp?diteurs par courriel.
>
> Ce courriel est r?serv? au seul destinataire indiqu? et peut renfermer des
> renseignements confidentiels et privil?gi?s. Si vous n'?tes pas le
> destinataire pr?vu, toute divulgation, duplication, utilisation ou
> distribution du courriel est interdite. Si vous avez re?u ce courriel par
> erreur, veuillez en aviser l'exp?diteur par courriel et d?truire
> imm?diatement le courriel et toute pi?ce jointe. Merci.
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>


-- 
OREXXMan
Q: What do you call the residence of the ungulate with the largest antlers?
A: A moose pad.
:-D
Would you rather pass data in move mode (*nix piping) or locate mode
(Pipes) or via disk (JCL)?  Why do you think you rarely see *nix commands
with more than a dozen filters, while Pipelines specifications are commonly
over 100s of stages, and 1000s of stages are not uncommon.
REXX is the new C.

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Having a little difficulty with a REXX command LMOPEN

2023-02-03 Thread Seymour J Metz
Why are you doing more than on open for the file? 

BTW, LMOPEN is an ISPF command and is available from, e.g. CLIST, HLASM, PL/I.


From: IBM Mainframe Discussion List  on behalf of 
Cameron Conacher <03cfc59146bb-dmarc-requ...@listserv.ua.edu>
Sent: Friday, February 3, 2023 8:18 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Having a little difficulty with a REXX command LMOPEN

Good Morning,
I have a small REXX which essentially copies members of one PDSE to another.

It iterates over members of the first PDSE and copies the members to the second 
PDSE.

After about eighty members are copied, my LMOPEN fails with a return code of 8.
I checked the manual and a return code of 8 from an LMOPEN means "The Dataset 
cannot be opened."
 8
Data set could not be opened.


Is there somewhere I can see a bit more detail. Why the dataset could not be 
opened?
I see nothing in the JES Log.

Any thoughts appreciated.

Thanks


Cameron Conacher
Senior Engineer

American Express Canada Inc.
GCICS
2225 Sheppard Avenue East, Toronto, ON  M2J 5C2

cameron.conac...@aexp.com<mailto:cameron.conac...@aexp.com>
Office: 1-437-836-5265
Mobile: 1-416-409-5147

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Famex.webex.com%2Fjoin%2Fcameron.conacher=05%7C01%7Csmetz3%40gmu.edu%7C9939c0554eb848b1812e08db05e93f68%7C9e857255df574c47a0c00546460380cb%7C0%7C0%7C638110271571167055%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=BMmLFuqzD1UqexM1ImJ8xYAzjedZT0imJDf3bi70i6w%3D=0

Note: I will be away from the office on PTO Friday February 3, 2023


American Express made the following annotations

This e-mail was sent to you by a representative of Amex Bank of Canada, P.O. 
Box 3204, Station "F", Toronto, ON, M1W 3W7, 
https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.americanexpress.ca%2F=05%7C01%7Csmetz3%40gmu.edu%7C9939c0554eb848b1812e08db05e93f68%7C9e857255df574c47a0c00546460380cb%7C0%7C0%7C638110271571167055%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=Jv7DioYt3ymS73cXtOPopT8w9pFFRRnoZ8Hj6BmALEU%3D=0.
 If you no longer wish to receive these e-mails, please notify the sender by 
reply e-mail.

This e-mail is solely for the intended recipient and may contain confidential 
or privileged information. If you are not the intended recipient, any 
disclosure, copying, use, or distribution of the information included in this 
e-mail is prohibited. If you have received this e-mail in error, please notify 
the sender by reply e-mail and immediately and permanently delete this e-mail 
and any attachments. Thank you.

American Express a fait les remarques suivantes
Ce courriel vous a ?t? envoy? par un repr?sentant de la Banque Amex du Canada, 
C.P. 3204, succursale F, Toronto (Ontario) M1W 3W7, 
https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.americanexpress.ca%2F=05%7C01%7Csmetz3%40gmu.edu%7C9939c0554eb848b1812e08db05e93f68%7C9e857255df574c47a0c00546460380cb%7C0%7C0%7C638110271571167055%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=Jv7DioYt3ymS73cXtOPopT8w9pFFRRnoZ8Hj6BmALEU%3D=0.
 Si, par la suite, vous ne souhaitez plus recevoir ces courriels, veuillez en 
aviser les exp?diteurs par courriel.

Ce courriel est r?serv? au seul destinataire indiqu? et peut renfermer des 
renseignements confidentiels et privil?gi?s. Si vous n'?tes pas le destinataire 
pr?vu, toute divulgation, duplication, utilisation ou distribution du courriel 
est interdite. Si vous avez re?u ce courriel par erreur, veuillez en aviser 
l'exp?diteur par courriel et d?truire imm?diatement le courriel et toute pi?ce 
jointe. Merci.

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Having a little difficulty with a REXX command LMOPEN

2023-02-03 Thread Lionel B. Dyck
Here is a sample that I wrote awhile ago to better understand how lmcopy
works - hope this helps - no lmopen required.

/* --- REXX --- *
* test code for lmcopy * 
*  */
in  = 'hlq.test.pds'  
out = 'hlq.test.pdse' 
Address ISPexec  
"lminit dataid(indd1) dataset('"in"')"   
"lminit dataid(outdd1) dataset('"out"')" 
"lmcopy fromid("indd1") todataid("outdd1")" ,
  "frommem(a*) replace"  
"lmcopy fromid("indd1") todataid("outdd1")" ,
  "frommem(b*) replace"  
"lmfree dataid("indd1")" 
"lmfree dataid("outdd1")"


Lionel B. Dyck <><
Website: https://www.lbdsoftware.com
Github: https://github.com/lbdyck

“Worry more about your character than your reputation. Character is what you
are, reputation merely what others think you are.”   - - - John Wooden

-----Original Message-
From: IBM Mainframe Discussion List  On Behalf Of
Cameron Conacher
Sent: Friday, February 3, 2023 7:19 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Having a little difficulty with a REXX command LMOPEN

Good Morning,
I have a small REXX which essentially copies members of one PDSE to another.

It iterates over members of the first PDSE and copies the members to the
second PDSE.

After about eighty members are copied, my LMOPEN fails with a return code of
8.
I checked the manual and a return code of 8 from an LMOPEN means "The
Dataset cannot be opened."
 8
Data set could not be opened.


Is there somewhere I can see a bit more detail. Why the dataset could not be
opened?
I see nothing in the JES Log.

Any thoughts appreciated.

Thanks


Cameron Conacher
Senior Engineer

American Express Canada Inc.
GCICS
2225 Sheppard Avenue East, Toronto, ON  M2J 5C2

cameron.conac...@aexp.com<mailto:cameron.conac...@aexp.com>
Office: 1-437-836-5265
Mobile: 1-416-409-5147

https://amex.webex.com/join/cameron.conacher

Note: I will be away from the office on PTO Friday February 3, 2023


American Express made the following annotations
 This e-mail was sent to you by a
representative of Amex Bank of Canada, P.O. Box 3204, Station "F", Toronto,
ON, M1W 3W7, www.americanexpress.ca. If you no longer wish to receive these
e-mails, please notify the sender by reply e-mail.

This e-mail is solely for the intended recipient and may contain
confidential or privileged information. If you are not the intended
recipient, any disclosure, copying, use, or distribution of the information
included in this e-mail is prohibited. If you have received this e-mail in
error, please notify the sender by reply e-mail and immediately and
permanently delete this e-mail and any attachments. Thank you.

American Express a fait les remarques suivantes Ce courriel vous a ?t?
envoy? par un repr?sentant de la Banque Amex du Canada, C.P. 3204,
succursale F, Toronto (Ontario) M1W 3W7, www.americanexpress.ca. Si, par la
suite, vous ne souhaitez plus recevoir ces courriels, veuillez en aviser les
exp?diteurs par courriel.

Ce courriel est r?serv? au seul destinataire indiqu? et peut renfermer des
renseignements confidentiels et privil?gi?s. Si vous n'?tes pas le
destinataire pr?vu, toute divulgation, duplication, utilisation ou
distribution du courriel est interdite. Si vous avez re?u ce courriel par
erreur, veuillez en aviser l'exp?diteur par courriel et d?truire
imm?diatement le courriel et toute pi?ce jointe. Merci.

--
For IBM-MAIN subscribe / signoff / archive access instructions, send email
to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: Having a little difficulty with a REXX command LMOPEN

2023-02-03 Thread Paul Gorlinsky
What functions are you using to copy the members… 

https://www.ibm.com/docs/en/zos/2.1.0?topic=services-lmopen-open-data-set 

There is a mention in the link that LMMOVE AND LMCOPY don’t require LMOPEN.  

Also are you following the LMOPEN with and LMCLOSE? 

You might need to create a list on members to move first, then do the moves or 
copies

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Having a little difficulty with a REXX command LMOPEN

2023-02-03 Thread Cameron Conacher
Good Morning,
I have a small REXX which essentially copies members of one PDSE to another.

It iterates over members of the first PDSE and copies the members to the second 
PDSE.

After about eighty members are copied, my LMOPEN fails with a return code of 8.
I checked the manual and a return code of 8 from an LMOPEN means "The Dataset 
cannot be opened."
 8
Data set could not be opened.


Is there somewhere I can see a bit more detail. Why the dataset could not be 
opened?
I see nothing in the JES Log.

Any thoughts appreciated.

Thanks


Cameron Conacher
Senior Engineer

American Express Canada Inc.
GCICS
2225 Sheppard Avenue East, Toronto, ON  M2J 5C2

cameron.conac...@aexp.com
Office: 1-437-836-5265
Mobile: 1-416-409-5147

https://amex.webex.com/join/cameron.conacher

Note: I will be away from the office on PTO Friday February 3, 2023


American Express made the following annotations

This e-mail was sent to you by a representative of Amex Bank of Canada, P.O. 
Box 3204, Station "F", Toronto, ON, M1W 3W7, www.americanexpress.ca. If you no 
longer wish to receive these e-mails, please notify the sender by reply e-mail.

This e-mail is solely for the intended recipient and may contain confidential 
or privileged information. If you are not the intended recipient, any 
disclosure, copying, use, or distribution of the information included in this 
e-mail is prohibited. If you have received this e-mail in error, please notify 
the sender by reply e-mail and immediately and permanently delete this e-mail 
and any attachments. Thank you.

American Express a fait les remarques suivantes
Ce courriel vous a ?t? envoy? par un repr?sentant de la Banque Amex du Canada, 
C.P. 3204, succursale F, Toronto (Ontario) M1W 3W7, www.americanexpress.ca. Si, 
par la suite, vous ne souhaitez plus recevoir ces courriels, veuillez en aviser 
les exp?diteurs par courriel.

Ce courriel est r?serv? au seul destinataire indiqu? et peut renfermer des 
renseignements confidentiels et privil?gi?s. Si vous n'?tes pas le destinataire 
pr?vu, toute divulgation, duplication, utilisation ou distribution du courriel 
est interdite. Si vous avez re?u ce courriel par erreur, veuillez en aviser 
l'exp?diteur par courriel et d?truire imm?diatement le courriel et toute pi?ce 
jointe. Merci.

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN