IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to filter PDS member using LMINIT (View 'PDS(M***160*))


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 271

PostPosted: Fri Oct 29, 2021 12:32 am
Reply with quote

Hi All,

I want to build a macro to filter the input PDS by masking like view 'PDS(M***160*) using LMINIT command, when I tried to use

DDNAME = DSNNAME || '(' || 'M***160*' || ')'
ADDRESS ISPEXEC "LMINIT DATAID("MYDS'") DATASET('"DDNAME"') ENQ(SHR)"
ADDRESS ISPEXEC "LMOPEN DATAID("MYDS'") OPTION(INPUT)"



got RC 12.
I did the search for any post similar but didn't find any. Also I read through the manuals.

View PDS(M***160*) is filtering the required name when it is issued in TSO command under 3.4 option but not sure how this can be done using LMINIT.

Please suggest.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Fri Oct 29, 2021 12:46 am
Reply with quote

You cannot filter at this level by member name.

You must access the PDS as a whole, then get its list of members, and then filter them using the mask, or whatever else.

That's it.

P.S.
The "triple asterisk" is not valid in a standard naming mask accepted by some standard tools. You can write your own one, to handle this if needed.
Back to top
View user's profile Send private message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 271

PostPosted: Fri Oct 29, 2021 1:00 am
Reply with quote

After
ADDRESS ISPEXEC 'LMLIST DATAID('MYDS') OPTION(LIST) MEMBER(MEMBER) STATS(NO)'

Can I give the masking as mentioned below.

ADDRESS ISPEXEC 'VIEW DATAID('MYDS') MEMBER(M***160*) MACRO(FETCH)'

I will try and let you know.
Back to top
View user's profile Send private message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 271

PostPosted: Fri Oct 29, 2021 1:13 am
Reply with quote

After Listing while passing the member with masking it worked.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Fri Oct 29, 2021 1:46 am
Reply with quote

pkmurali wrote:
Code:
ADDRESS ISPEXEC "LMINIT DATAID("MYDS'") DATASET('"DDNAME"') ENQ(SHR)"
ADDRESS ISPEXEC "LMOPEN DATAID("MYDS'") OPTION(INPUT)"

AFAIR, the LMINIT takes the output parameter DATAID by name (to assign an unique value to this REXX variable), while all other LMM functions take this input parameter by value.
That is, in LMINIT the MYID must be given inside the outer quotes, as the name, but in all other LMM - out of quotes, for its value to be substituted by REXX as parameter value.

Besides of this, a single quote after MYDS is definitely a syntax error.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts SET PATH in View DDL DB2 2
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts Issues with VIEW DATASET Command CLIST & REXX 2
No new posts Difference when accessing dataset in ... JCL & VSAM 7
No new posts Help to Filter File Manager Copybook ... DFSORT/ICETOOL 14
Search our Forums:

Back to Top