File declaration with UT-S.

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
Neeraj N
Registered Member
Posts: 54
Joined: Tue Aug 20, 2013 12:49 pm

File declaration with UT-S.

Post by Neeraj N »

Hi,

I have about the file declaration in the FILE CONTROL REGION. The code I have looks this-

Code: Select all

SELECT MST-FILE ASSIGN TO UT-S-MST. 
SELECT SALES-FILE ASSIGN TO UT-S-SALES. 
SELECT FINAL-RCT ASSIGN TO UT-S-RCT. 
In the JCL we only use MST etc. as the DD name then in the bove code why are we using this UT-S in the assign clause?

If anybody can share some knowledge on this, please share.
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 826
Joined: Wed Sep 11, 2013 3:57 pm

Re: File declaration with UT-S.

Post by enrico-sorichetti »

everything is explained in the cobol manuals
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: File declaration with UT-S.

Post by nicc »

But it is part of COBOL history. Modern programs do not use that naming method.
Regards
Nic
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: File declaration with UT-S.

Post by William Collins »

Yes, although I saw someone using this the other day, you'll need to fine an old (pre-Enterprise COBOL) manual to see what they were for.

Entirely unnecessary these days, as nicc pointed out. Only take any notice of anything after the final "-" (if there are any) except for a VSAM ESDS, which an Enterprise COBOL manual will tell you what that is dealt with as.

Apparently some people prefer to provide an indication of the file being QSAM rather than a VSAM KSDS. That's a pretty silly idea. Just keep it simple.
User avatar
Anuj Dhawan
Founder
Posts: 2802
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: File declaration with UT-S.

Post by Anuj Dhawan »

As has been talked about, that's an old way of coding practice. One of them is known as "class indicator" and other is "Label".

Class Indicator: The Class Indicator can be and have the following meanings:

UR = Unit Record - card reader, card punch, printer

UT = Utility - Tape or Disk or Drum or Cell (note: if UT and Disk or Tape, organization must be S)

DA = Direct Access - Disk, Drum or Cell (note: organization indicator must be I or D).

Check this see http://publib.boulder.ibm.com/cgi-bin/b ... 05/4.2.3.1 to see what is not "meaningful" in currently supported IBM mainframe compilers on OS/390, z/OS, or VM environment.

More than "old days" ago there were disk drives and tapes were "utility devices". Concept of a utility-device changed when the first 2311s arrived, but COBOL supported either tape or disk as 'Utility'.

"DA" was for "Direct Access" and that meant "non-sequential" and therefore could NOT be a UTILITY device. The "UR" meant "Unit Record" which really meant "unblocked" (early printers and punch card readers/punches accepted a single "record"). It was only later when we started spooling print to disk that print files became "blocked", but COBOL still allowed them to be treated as "unit record" (as it does to this day... I think I'm correct here?).

To summarize it all, for theory, - DA (mass storage); UT (utility) and UR (unit-record).

Label: Was used to documents the device and device class to which a file is assigned. With modern compilers it's not required but if specified, it must end with a hyphen. It can have the following meanings:

S- for QSAM files, the S- (organization) field can be omitted.

AS- for VSAM sequential files, the AS- (organization) field must be specified.

For VSAM indexed and relative files, the organization field must be omitted. So it's not used.

Hope this helps.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anithab
Registered Member
Posts: 44
Joined: Mon May 26, 2014 2:57 pm

Re: File declaration with UT-S.

Post by Anithab »

Hi all,

I have been reading through this,will changing the label name have an impact on performance ?
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: File declaration with UT-S.

Post by William Collins »

No.
Neeraj N
Registered Member
Posts: 54
Joined: Tue Aug 20, 2013 12:49 pm

Re: File declaration with UT-S.

Post by Neeraj N »

Anuj Dhawan wrote:As has been talked about, that's an old way of coding practice. One of them is known as "class indicator" and other is "Label".

Class Indicator: The Class Indicator can be and have the following meanings:

UR = Unit Record - card reader, card punch, printer

UT = Utility - Tape or Disk or Drum or Cell (note: if UT and Disk or Tape, organization must be S)

DA = Direct Access - Disk, Drum or Cell (note: organization indicator must be I or D).

Check this see http://publib.boulder.ibm.com/cgi-bin/b ... 05/4.2.3.1 to see what is not "meaningful" in currently supported IBM mainframe compilers on OS/390, z/OS, or VM environment.

More than "old days" ago there were disk drives and tapes were "utility devices". Concept of a utility-device changed when the first 2311s arrived, but COBOL supported either tape or disk as 'Utility'.

"DA" was for "Direct Access" and that meant "non-sequential" and therefore could NOT be a UTILITY device. The "UR" meant "Unit Record" which really meant "unblocked" (early printers and punch card readers/punches accepted a single "record"). It was only later when we started spooling print to disk that print files became "blocked", but COBOL still allowed them to be treated as "unit record" (as it does to this day... I think I'm correct here?).

To summarize it all, for theory, - DA (mass storage); UT (utility) and UR (unit-record).

Label: Was used to documents the device and device class to which a file is assigned. With modern compilers it's not required but if specified, it must end with a hyphen. It can have the following meanings:

S- for QSAM files, the S- (organization) field can be omitted.

AS- for VSAM sequential files, the AS- (organization) field must be specified.

For VSAM indexed and relative files, the organization field must be omitted. So it's not used.

Hope this helps.
Thanks for the detailed explnation Anuj. This clears up a lot of doubts. :)

So basically they are not reqired but if they are existing in the code they won't harm the program?
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: File declaration with UT-S.

Post by William Collins »

Correct. Leave them if they already exist. Don't code them in new programs. When changing programs and adding a SELECT, do one or the other depending on the strategy for adding the code (sometimes you want the code to "blend in" with the rest of the program, sometimes that is not necessary, down to local standards).
Anithab
Registered Member
Posts: 44
Joined: Mon May 26, 2014 2:57 pm

Re: File declaration with UT-S.

Post by Anithab »

Sure Willian Thanks ( Sorry for the late reply)
Neeraj N
Registered Member
Posts: 54
Joined: Tue Aug 20, 2013 12:49 pm

Re: File declaration with UT-S.

Post by Neeraj N »

William Collins wrote:Correct. Leave them if they already exist. Don't code them in new programs. When changing programs and adding a SELECT, do one or the other depending on the strategy for adding the code (sometimes you want the code to "blend in" with the rest of the program, sometimes that is not necessary, down to local standards).
Thank you. I understand what you mean.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”