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 <[email protected]> On Behalf Of Cameron Conacher Sent: Sunday, February 5, 2023 3:59 PM To: [email protected] 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 <[email protected]> On Behalf Of Hobart Spitz Sent: Sunday, February 5, 2023 4:41 PM To: [email protected] 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) 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 < [email protected]<mailto:[email protected]>> 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 > <[email protected]<mailto:[email protected]>> On Behalf > Of Hobart Spitz > Sent: Sunday, February 5, 2023 1:56 PM > To: [email protected]<mailto:[email protected]> > 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 < > [email protected]<mailto:[email protected]><mailto: > [email protected]<mailto:[email protected]>>> > 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 > > <[email protected]<mailto:[email protected]><mailto: > [email protected]<mailto:[email protected]>>> On Behalf > > Of Lionel B. Dyck > > Sent: Friday, February 3, 2023 8:39 AM > > To: > > [email protected]<mailto:[email protected]><mailto:IBM > > [email protected]<mailto:[email protected]>> > > 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/3735 > > 928037/https:/www.lbdsoftware.com>< > https://isolate.menlosecurity.com/1/3735928037/https:/www.lbdsoftware. > com > >< > > > https://isolate.menlosecurity.com/1/3735928037/https:/www.lbdsoftware. > com> > > Github: > > https://github.com/lbdyck<https://isolate.menlosecurity.com/1/373592 > > 8037/https:/github.com/lbdyck>< > https://isolate.menlosecurity.com/1/3735928037/https:/github.com/lbdyc > k><<https://isolate.menlosecurity.com/1/3735928037/https:/github.com/l > bdyck%3e%3c> > > https://isolate.menlosecurity.com/1/3735928037/https:/github.com/lbd > > yck> > > > > "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 > > <[email protected]<mailto:[email protected]><mailto: > [email protected]<mailto:[email protected]>><mailto: > > [email protected]<mailto:[email protected]><mailto:IBM > > [email protected]<mailto:[email protected]>>>> On Behalf > > Of Cameron Conacher > > Sent: Friday, February 3, 2023 7:19 AM > > To: > > [email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>><mailto: > [email protected]<mailto:[email protected]><mailto:IBM-M > [email protected]<mailto:[email protected]>>> > > 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 > > > > [email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>><mailto: > [email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>>><mailto: > > [email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>><mailto: > [email protected]<mailto:[email protected]><mailto:Cam > [email protected]<mailto:[email protected]>>>> > > 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/373592803 > > 7/http:/www.americanexpress.ca>< > https://isolate.menlosecurity.com/1/3735928037/http:/www.americanexpre > ss.ca > >< > > > https://isolate.menlosecurity.com/1/3735928037/http:/www.americanexpre > ss.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/373592803 > > 7/http:/www.americanexpress.ca>< > https://isolate.menlosecurity.com/1/3735928037/http:/www.americanexpre > ss.ca > >< > > > https://isolate.menlosecurity.com/1/3735928037/http:/www.americanexpre > ss.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 > > [email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>><mailto: > [email protected]<mailto:[email protected]><mailto:lists > [email protected]<mailto:[email protected]>>> with the > > message: INFO IBM-MAIN > > > > > >--------------------------------------------------------------------- > >- For IBM-MAIN subscribe / signoff / archive access instructions, > >send email to > >[email protected]<mailto:[email protected]><mailto:list > >[email protected]<mailto:[email protected]> > ><mailto:[email protected]<mailto:[email protected]><mai > >lto:[email protected]<mailto:[email protected]>>> > > with the message: INFO IBM-MAIN > > ________________________________ > > 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> > < > https://isolate.menlosecurity.com/1/3735928037/http:/www.americanexpre > ss.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/373592803 > > 7/http:/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 instructions, > > send email to > > [email protected]<mailto:[email protected]><mailto:lis > > [email protected]<mailto:[email protected]>> > with the message: INFO IBM-MAIN > > > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, send > email to > [email protected]<mailto:[email protected]><mailto:lists > [email protected]<mailto:[email protected]>> > with the message: INFO IBM-MAIN > ________________________________ > 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 instructions, send > email to [email protected]<mailto:[email protected]> > with the message: INFO IBM-MAIN > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected]<mailto:[email protected]> with the message: INFO IBM-MAIN ________________________________ 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 [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
