MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

RC 12 from LMMLIST

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 614
Topics: 171
Location: Stockholm, Sweden

PostPosted: Tue Jan 03, 2023 10:54 am    Post subject: RC 12 from LMMLIST Reply with quote

I wonder if anyone can share any light on what this problem might be caused by.
I use an action bar drop down to show a list of members in a PDS.
The code is as follows (I've deleted the actual trace SAY lines for clarity)
Code:

/*******************************************************************
 get a list of the member names in the filename passed in           
*******************************************************************/
pdsmemb:                                                           
  say 'In pdsmemb in 'rname ; trace ?a                             
                                                                   
arg dsn                                                             
dsn = "'"dsn"'"                                                     
drop mem.                                                                           
zerrlm = ''                                                         
                                                                   
address TSO "FREE DA("dsn")"                                       
Address ISPEXEC "LMINIT DATAID(DSET) DATASET("dsn")"               
Address ISPEXEC "LMOPEN DATAID("DSET")" OPTION(INPUT)"
mem = ''                                                           
                                                             
do forever                                                   
                                                             
  Address ISPEXEC ,                                         
    "LMMLIST DATAID("DSET") OPTION(LIST) MEMBER(MEMBER)"     
  lmmlist_rc = rc                                                                               
  if lmmlist_rc > 7 then                                     
    leave                                                   
  mem = mem!!strip(member)'ยง'                               
                                                             
end                                                         
                                                             
Address ISPEXEC "LMCLOSE DATAID("DSET")"                     
Address ISPEXEC "LMFREE DATAID("DSET")"                     
                                                             
/* Okay, mem. contains all the PDS members */               
                                                             
return mem                                                   


Here are the results. First, if I simply start the panel and select the action bar straight away, it fetches all 7 member in the PDS.
Quote:

In pdsmemb in MSDB2UNL
3758 *-* arg dsn
+++ Interactive trace. TRACE OFF to end debug, ENTER to continue. +++
trace off
Line 3760 setting sw_trace to 1
DATA SET S6843F.MSDB2.UNLOAD NOT FREED, DATA SET IS OPEN
Line 3761 FREE DA 'S6843F.MSDB2.UNLOAD' RC = 12
Line 3760 LMINIT on dataset 'S6843F.MSDB2.UNLOAD' RC = 0
Line 3764 LMOPEN on dataid ISR00052 RC = 0
Line 3774 LMMLIST on dataid ISR00052 RC = 0 zerrlm=
Line 3774 LMMLIST on dataid ISR00052 RC = 0 zerrlm=
Line 3774 LMMLIST on dataid ISR00052 RC = 0 zerrlm=
Line 3774 LMMLIST on dataid ISR00052 RC = 0 zerrlm=
Line 3774 LMMLIST on dataid ISR00052 RC = 0 zerrlm=
Line 3774 LMMLIST on dataid ISR00052 RC = 0 zerrlm=
Line 3774 LMMLIST on dataid ISR00052 RC = 0 zerrlm=
Line 3774 LMMLIST on dataid ISR00052 RC = 8 zerrlm=No more members in this data
set.
Line 3783 LMCLOSE on dataid ISR00052 RC = 0
Line 3786 LMFREE on dataid ISR00052 RC = 0


and now if I first run code that accesses a DB2 table (in the same machine as the Rexx code) and writes whatever is extracted to an output file.
Quote:

In pdsmemb in MSDB2UNL
3758 *-* arg dsn
+++ Interactive trace. TRACE OFF to end debug, ENTER to continue. +++
trace off
Line 3760 setting sw_trace to 1
DATA SET S6843F.MSDB2.UNLOAD NOT FREED, DATA SET IS OPEN
Line 3761 FREE DA 'S6843F.MSDB2.UNLOAD' RC = 12
Line 3760 LMINIT on dataset 'S6843F.MSDB2.UNLOAD' RC = 0
Line 3764 LMOPEN on dataid ISR00053 RC = 0
Line 3774 LMMLIST on dataid ISR00053 RC = 12 zerrlm=Member name must be 1 to 8
characters long.
Line 3783 LMCLOSE on dataid ISR00053 RC = 0
Line 3786 LMFREE on dataid ISR00053 RC = 0

The manual says that rc 12 from LMMLIST is one of the following:-
Quote:

One of these:
The data set is not open or is not partitioned. (well, it's certainly partitioned)
A parameter value is invalid. (which would that be?)
Member list was created using LMMDISP. (I don't use LMMDISP anywhere in any Rexx script)


I have a variation on the SQL/Rexx code that checks the validity of the actual SQL. If I run this instead (which does NOT create any output files) then the LMMLIST works fine.

The weird (?) thing is the following.
- use the action bar (everything works fine)
- run the SQL/Rexx code and create an output file
- use the action bar which gives rc = 12 and an empty panel list
- use the action bar AGAIN, and the correct results are fetched and shown
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12354
Topics: 75
Location: San Jose

PostPosted: Tue Jan 03, 2023 6:52 pm    Post subject: Re: RC 12 from LMMLIST Reply with quote

misi01,

Isn't the issue on FREEing the dataset?

misi01 wrote:

DATA SET S6843F.MSDB2.UNLOAD NOT FREED, DATA SET IS OPEN
Line 3761 FREE DA 'S6843F.MSDB2.UNLOAD' RC = 12


misi01 wrote:

DATA SET S6843F.MSDB2.UNLOAD NOT FREED, DATA SET IS OPEN
Line 3761 FREE DA 'S6843F.MSDB2.UNLOAD' RC = 12


So is the dataset S6843F.MSDB2.UNLOAD allocated to another DDname ?
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
misi01
Advanced


Joined: 02 Dec 2002
Posts: 614
Topics: 171
Location: Stockholm, Sweden

PostPosted: Wed Jan 04, 2023 2:34 am    Post subject: Reply with quote

Thanks for your suggestion. The error turned out to be the following. I had some code that did the following
Code:

rc = check_valid_member(filename)     
if rc <> 'OK' then                     
  do                                   
    replace.0 = 0                     
    return 1                           
  end                                 

where check_valid_member contained originally
Code:

check_valid_member:                 
arg member        <---------------- Note this error                       
                                   
xx = msg('OFF')                     
rc = sysdsn("'"filename"'")         
xx = msg(xx)                       
                                   
return rc 

This error was then screwing up the contents of MEMBER elsewhere.
Once I changed MEMBER to FILENAME, the code worked as expected.
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group