Page 1 of 1

File declaration with UT-S.

Posted: Thu Sep 10, 2015 1:47 pm
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.

Re: File declaration with UT-S.

Posted: Thu Sep 10, 2015 2:23 pm
by enrico-sorichetti
everything is explained in the cobol manuals

Re: File declaration with UT-S.

Posted: Thu Sep 10, 2015 3:23 pm
by nicc
But it is part of COBOL history. Modern programs do not use that naming method.

Re: File declaration with UT-S.

Posted: Thu Sep 10, 2015 4:11 pm
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.

Re: File declaration with UT-S.

Posted: Mon Sep 14, 2015 11:53 am
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.

Re: File declaration with UT-S.

Posted: Wed Sep 16, 2015 9:21 pm
by Anithab
Hi all,

I have been reading through this,will changing the label name have an impact on performance ?

Re: File declaration with UT-S.

Posted: Wed Sep 16, 2015 9:24 pm
by William Collins
No.

Re: File declaration with UT-S.

Posted: Mon Sep 21, 2015 12:07 pm
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?

Re: File declaration with UT-S.

Posted: Mon Sep 21, 2015 3:08 pm
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).

Re: File declaration with UT-S.

Posted: Wed Nov 04, 2015 9:11 pm
by Anithab
Sure Willian Thanks ( Sorry for the late reply)

Re: File declaration with UT-S.

Posted: Mon Dec 14, 2015 7:15 pm
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.