1. LMINIT allocates a new DD. The DDNAME is placed in the variable you 
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.

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).

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.

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.

Jon Perryman.



>________________________________
> From: "Hansen, Dave L - Eagan, MN" <dave.l.han...@usps.gov>
>
>
>   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".
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to