Lua4z
A binary distribution of Lua for z/OS, with batteries

Module ispf.lmmlist

Classes for ISPF member lists.

Functions

open (dsname, enq) Initializes and opens a PDS library.
close () Closes and frees the library.
list () Gets the list of members in a library.

Functions

open (dsname, enq)
Initializes and opens a PDS library.

You can call lmmlist(...) as shorthand for lmmlist.open(...).

Parameters:

  • dsname
  • enq

Returns:

    A table that represents the new member list.

Usage:

     -- Print the member names of the specifed library
     -- Library dsname supplied as command-line argument
     -- For example: LUA 'MYID.PDS'
     -- (single quotes indicate fully qualified dsname)
     local lmmlist = require("ispf.lmmlist")
    
     local dsname = arg[1]
     local enq = "shr"
    
     lmmlist(dsname, enq):
       map( function (member) print(member.name) end )
close ()
Closes and frees the library. This function calls the LMCLOSE z/OS ISPF service followed by the LMFREE z/OS ISPF service.

Returns:

    The return code from either the LMCLOSE or LMFREE service.
list ()
Gets the list of members in a library.

This function calls various z/OS ISPF services.

Returns:

    An iterator function that, each time it is called, returns the next member.

Usage:

     local lmmlist = require("ispf.lmmlist")
     local dsname = "MYID.PDS"
     local library = lmmlist.open(dsname, "SHR")
     for member in library:list() do
       print(member.name)
     end