Page 1 of 1

a member in a pds

PostPosted: Thu Oct 09, 2008 1:18 pm
by karthik017
Hi im creating a panel to find the presence of a pds and its member.1.The “DATASET NAME” should be an existing PDS. If not present, system should prompt the user to enter an existing PDS(i did it).
2.If the given “MEMBER NAME” not present in the PDS, create a new member with the given name.So tell me how to do the 2nd one?

Re: a member in a pds

PostPosted: Thu Oct 09, 2008 2:41 pm
by MrSpock
Since you're using ISPF panels, I have to presume that you're familiar with and comfortable using ISPF Services.

I'd use the following Library Management services:

LMINIT.
LMOPEN.
LMMFIND.
LMMADD.
LMCLOSE.

Re: a member in a pds

PostPosted: Fri Oct 31, 2008 8:59 pm
by Gilles
You can also use the EDIT command. If your member exists, it'll open it. If it doesn't, you'll be presented with an empty member with the new name.

DSNAME = whatever dataset name
MEMBER = whatever member name
"ISPEXEC EDIT DATASET('" || DSNAME || "(" || MEMBER || ")')"