On Wed, 23 Oct 2013 09:21:25 -0700, Jon Perryman wrote: >1. LMINIT allocates a new DD. The DDNAME is placed in the variable you >specified in DATAID.� > I hadn't known this; I still don't believe it; rather LMINIT uses the DDNAME given and places a generated name in the variable specified in DATAID.
2. If a DD is allocated DISP=OLD, then this dataset cannot be allocated in another DD. This is why LMINIT fails. You can change the ALLOC to SHR and it will succeed. > I agree. 3. LMINIT allows dsn and DISP to be specified. The ALLOC's are not necessary �unless you have them for another reason. LMINIT DATAID(XXX) DATASET('xxx') ENQ(EXCLU). EXCLU is DISP=OLD. 4. LMCOPY and LMFREE must use a variable in the dataid. Assuming this is clist, you would code LMCOPY FROMID(&INDD) TOID(&OUTDD). LMINIT does NOT use a varialbe (it specifies a variable name where it will store the allocated DD). > What's this ampersand business? I agree (once the correct apostrophes are added) with the OP's: 'LMCOPY FROMID('INDD') TODATAID('OUTDD') FROMMEM(mema) TOMEM(mema) REPLACE' 5. You should not use TSO FREE(&INDD &OUTDD). LMFREE should be used for this functionality because it will also clean up ISPF information about the allocated datasets. > If you use TSO ALLOCATE (as in the OP's example), you should use TSO FREE. 6. You could theoretically use the DDNAMES in the variables for TSO commands but I always use TSO ALLOC for TSO functionality. The advantage of LMINIT is the dynamic DD name generated avoids possible collisions. > BPXWDYN has a similar capability. I'd have used that. >________________________________ > From: "Hansen, Dave L - Eagan, MN" > > >� LMFREE doesn't have any extra parameters.� I keep getting a message about >"ALREADY IN USE,� TRY LATER+", "DATA SET IS ALLOCATED TO ANOTHER JOB OR >USER".� GRS shows I'm doing this to myself.� This is my LMCOPY EXEC: > >� ALLOC FI(LMIN)� � DA('file1') OLD REUSE >� ALLOC FI(LMOUT) DA('file2') OLD REUSE >� Address ISPEXEC >� LMINIT DATAID(INDD) DNAME(LMIN) ENQ(SHRW) >� LMINT DATAID(OUTDD) DDNAME(LMOUT) ENQ(SHRW) >� LMCOPY FROMID('INDD') TODATAID('OUTDD') FROMMEM(mema) TOMEM(mema) REPLACE >� LMFREE DATAID('INDD') >� LMFREE DATAID('OUTDD') > >� The LMFREE does not generate an error.� I get no errors running the EXEC >and it does what I want.� Except it's doesn't free my dataset. > >� I added:� Address TSO FREE FI(INDD OUTDD).� It generated an error "FILE >INDD NOT FREED, IS NOT ALLOCATED". -- gil ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN