Finding the JCL UNIT name 
Author Message
 Finding the JCL UNIT name

Thanks to those who replied on my previous query.  Now here's
another one, for good measure.

If my JCL has:
    //DDNAME  DD  ...,UNIT=xxxxxxxx
then how can I find, within my program, what the UNIT value was?
I've been hunting for this, off and on, for months, without any luck.
It must be stored somewhere, surely?

Cheers,
Allen



Sat, 01 Feb 2003 12:30:13 GMT  
 Finding the JCL UNIT name

said:

Quote:
>If my JCL has:
>    //DDNAME  DD  ...,UNIT=xxxxxxxx
>then how can I find, within my program, what the UNIT value was?

I believe SWA Create puts the UNIT name in SCTUTYPE but, later on, it gets
converted to internal format (UCBTYP) and stored in SIOTDEVT.  Since
SIOTDEVT overlays the first four bytes of SCTUTYPE, your program may have
to convert SIOTDEVT back to a UNIT name using IEFEB4UV or similar.

 Gilbert Saint-flour
 http://members.home.net/gsf/



Sat, 01 Feb 2003 03:00:00 GMT  
 Finding the JCL UNIT name
Use the DEVTYPE macro documented in DFSMS Advanced Services SC26-4921 and
the EDTINFO
macro documented in MVS Assembler Services Reference GC28-1910

            DEVTYPE DDNAME,AREA,INFOLIST=INFO
            EDTINFO RTNUNIT,DEVTYPE=AREA,UNITNAME=UNIT

UNIT         DS    CL8
DDNAME DS    CL8
AREA        DS    XL4
INFO        DEVTYPE INFO=DEVTYPE



Sat, 01 Feb 2003 03:00:00 GMT  
 Finding the JCL UNIT name
Unfortunately, there is no EASY way for you to get the *coded* unitname.  If
you code UNIT=TAPE for a cataloged dasd dataset, it is ignored as it is not
a subset of the device type.  All you can get from SWA is the device type.
Of course you can convert it back, as others have mentioned.

If you NEED the coded unitname, you *could* read and parse the internal
text.  That's the only place where you can really find out what was coded in
JCL.
--
Dan

Quote:
> >"Allen Gainsford"
> >If my JCL has:
> >    //DDNAME  DD  ...,UNIT=xxxxxxxx
> >then how can I find, within my program, what the UNIT value was?
>"Gilbert Saint-flour"
> I believe SWA Create puts the UNIT name in SCTUTYPE but, later on, it gets
> converted to internal format (UCBTYP) and stored in SIOTDEVT.  Since
> SIOTDEVT overlays the first four bytes of SCTUTYPE, your program may have
> to convert SIOTDEVT back to a UNIT name using IEFEB4UV or similar.



Sat, 01 Feb 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. finding JCL references

2. Passing a parameter Rexx to JCL and return a parameter to JCL

3. Passing variables between JCL and Rex / Rexx and JCL

4. Filenames vs Compilation Unit Names

5. File naming in GNAT and multiple units/file

6. Potentially.Long.Expanded.Names.Using.Ada.9X.Child.Units

7. A question about weird file names associated with Fortran unit numbers

8. finding how a unit is with'ed in

9. File name conventions for Ada units

10. Multiple same construct name in program unit

11. finding an unused unit # for I/O

12. Finding a valid unit number.

 

 
Powered by phpBB® Forum Software