Discussion:
Cobol Select and Assign
Ron Hudson
2010-06-16 18:17:55 UTC
Permalink
Hi everyone,

I apologize to those I annoy - I have been Googling to try to find answers
and
basically only find frustration.


I thought this would be easier - a checkbook totaling program written in
cobol.

I want to read a file specified in my JCL and produce printed lines on the
printer.
I will also be reading a number from each record and keeping several sums.

Right now I am having problems specifying the file my program will interact
with. Also
the printer.

I have read all over the place, but I think most of what I have read
pertains to newer
versions of cobol.

00003 000700 ENVIRONMENT DIVISION.
00
00004 CONFIGURATION SECTION.
00005 000800 SOURCE-COMPUTER. IBM-370.
00
00006 000900 OBJECT-COMPUTER. IBM-370.
00
00007 INPUT-OUTPUT SECTION.
00008 FILE-CONTROL.
00009 SELECT REGISTER-FILE
00010 ASSIGN TO DDREG
00011 ORGANIZATION IS SEQUENTIAL.
00012 SELECT REPORT-FILE
00013 ASSIGN TO SYSPRINT.

And this is what cobol says about it....

CARD ERROR MESSAGE

11 IKF1155I-W DEVICE CLASS INVALID IN SYSTEM-NAME. SKIPPING
TO NEXT FIELD.
11 IKF1141I-W FILE ORGANIZATION FIELD INVALID IN SYSTEM-NAME.
SEQUENTIAL ASSUMED.
11 IKF1157I-E EXTERNAL-NAME NOT PRESENT IN SYSTEM-NAME.
11 IKF1017I-E IS INVALID IN SELECT CLAUSE. SKIPPING TO NEXT CLAUSE.
13 IKF1155I-W DEVICE CLASS INVALID IN SYSTEM-NAME. SKIPPING
TO NEXT FIELD.
13 IKF1141I-W FILE ORGANIZATION FIELD INVALID IN SYSTEM-NAME.
SEQUENTIAL ASSUMED.
13 IKF1157I-E EXTERNAL-NAME NOT PRESENT IN SYSTEM-NAME.
9 IKF2133I-W LABEL RECORDS CLAUSE MISSING. DD CARD OPTION
WILL BE TAKEN.




There are a bunch of other messages, but I think they are triggered by
these. I have tried several things
for both the register-file and the report-file (actually - the printer I
hope) instead of SYSPRINT I have had
PRINTER, and instead of DDREG I have had DISK and FILE.

Ron.
Jean-Marie Bodin
2010-06-16 21:27:27 UTC
Permalink
Hi

Try this

00007 INPUT-OUTPUT SECTION.
00008 FILE-CONTROL.
00009 SELECT REGISTER-FILE
00010 ASSIGN TO UT-S-DDREG.
00012 SELECT REPORT-FILE
00013 ASSIGN TO UT-S-SYSPRINT.

jm
----- Original Message -----
From: Ron Hudson
To: turnkey-mvs-***@public.gmane.org
Sent: Wednesday, June 16, 2010 8:17 PM
Subject: [turnkey-mvs] Cobol Select and Assign




Hi everyone,

I apologize to those I annoy - I have been Googling to try to find answers and
basically only find frustration.


I thought this would be easier - a checkbook totaling program written in cobol.

I want to read a file specified in my JCL and produce printed lines on the printer.
I will also be reading a number from each record and keeping several sums.

Right now I am having problems specifying the file my program will interact with. Also
the printer.

I have read all over the place, but I think most of what I have read pertains to newer
versions of cobol.


00003 000700 ENVIRONMENT DIVISION. 00
00004 CONFIGURATION SECTION.00005 000800 SOURCE-COMPUTER. IBM-370. 0000006 000900 OBJECT-COMPUTER. IBM-370. 00
00007 INPUT-OUTPUT SECTION.00008 FILE-CONTROL.00009 SELECT REGISTER-FILE00010 ASSIGN TO DDREG00011 ORGANIZATION IS SEQUENTIAL.00012 SELECT REPORT-FILE
00013 ASSIGN TO SYSPRINT.And this is what cobol says about it....


CARD ERROR MESSAGE 11 IKF1155I-W DEVICE CLASS INVALID IN SYSTEM-NAME. SKIPPING TO NEXT FIELD.
11 IKF1141I-W FILE ORGANIZATION FIELD INVALID IN SYSTEM-NAME. SEQUENTIAL ASSUMED. 11 IKF1157I-E EXTERNAL-NAME NOT PRESENT IN SYSTEM-NAME. 11 IKF1017I-E IS INVALID IN SELECT CLAUSE. SKIPPING TO NEXT CLAUSE.
13 IKF1155I-W DEVICE CLASS INVALID IN SYSTEM-NAME. SKIPPING TO NEXT FIELD. 13 IKF1141I-W FILE ORGANIZATION FIELD INVALID IN SYSTEM-NAME. SEQUENTIAL ASSUMED. 13 IKF1157I-E EXTERNAL-NAME NOT PRESENT IN SYSTEM-NAME.
9 IKF2133I-W LABEL RECORDS CLAUSE MISSING. DD CARD OPTION WILL BE TAKEN.


There are a bunch of other messages, but I think they are triggered by these. I have tried several things
for both the register-file and the report-file (actually - the printer I hope) instead of SYSPRINT I have had
PRINTER, and instead of DDREG I have had DISK and FILE.

Ron.
Ron Hudson
2010-06-16 22:38:39 UTC
Permalink
what kind of magic is "UT-S-<my original name>"

Do I refer to them in runtime JCL as:

//DDREG DD DSN=HUDSON.DATA.DATA(CHKREG),DISP=SHR
//SYSPRINT DD SYSPRINT=A

??


On Wed, Jun 16, 2010 at 2:27 PM, Jean-Marie Bodin
Post by Jean-Marie Bodin
Hi
Try this
00007 INPUT-OUTPUT SECTION.
00008 FILE-CONTROL.
00009 SELECT REGISTER-FILE
00010 ASSIGN TO UT-S-DDREG.
00012 SELECT REPORT-FILE
00013 ASSIGN TO UT-S-SYSPRINT.
jm
----- Original Message -----
*Sent:* Wednesday, June 16, 2010 8:17 PM
*Subject:* [turnkey-mvs] Cobol Select and Assign
Hi everyone,
I apologize to those I annoy - I have been Googling to try to find answers and
basically only find frustration.
I thought this would be easier - a checkbook totaling program written in cobol.
I want to read a file specified in my JCL and produce printed lines on the printer.
I will also be reading a number from each record and keeping several sums.
Right now I am having problems specifying the file my program will interact with. Also
the printer.
I have read all over the place, but I think most of what I have read pertains to newer
versions of cobol.
00003 000700 ENVIRONMENT DIVISION. 00
00004 CONFIGURATION SECTION.
00005 000800 SOURCE-COMPUTER. IBM-370. 00
00006 000900 OBJECT-COMPUTER. IBM-370. 00
00007 INPUT-OUTPUT SECTION.
00008 FILE-CONTROL.
00009 SELECT REGISTER-FILE
00010 ASSIGN TO DDREG
00011 ORGANIZATION IS SEQUENTIAL.
00012 SELECT REPORT-FILE
00013 ASSIGN TO SYSPRINT.
And this is what cobol says about it....
CARD ERROR MESSAGE
11 IKF1155I-W DEVICE CLASS INVALID IN SYSTEM-NAME. SKIPPING TO NEXT FIELD.
11 IKF1141I-W FILE ORGANIZATION FIELD INVALID IN SYSTEM-NAME. SEQUENTIAL ASSUMED.
11 IKF1157I-E EXTERNAL-NAME NOT PRESENT IN SYSTEM-NAME.
11 IKF1017I-E IS INVALID IN SELECT CLAUSE. SKIPPING TO NEXT CLAUSE.
13 IKF1155I-W DEVICE CLASS INVALID IN SYSTEM-NAME. SKIPPING TO NEXT FIELD.
13 IKF1141I-W FILE ORGANIZATION FIELD INVALID IN SYSTEM-NAME. SEQUENTIAL ASSUMED.
13 IKF1157I-E EXTERNAL-NAME NOT PRESENT IN SYSTEM-NAME.
9 IKF2133I-W LABEL RECORDS CLAUSE MISSING. DD CARD OPTION WILL BE TAKEN.
There are a bunch of other messages, but I think they are triggered by
these. I have tried several things
for both the register-file and the report-file (actually - the printer I
hope) instead of SYSPRINT I have had
PRINTER, and instead of DDREG I have had DISK and FILE.
Ron.
gibney
2010-06-16 23:33:42 UTC
Permalink
UT means a "unit record" device. S means sequential, as the second message
assumed.



From: turnkey-mvs-***@public.gmane.org [mailto:turnkey-mvs-***@public.gmane.org] On
Behalf Of Ron Hudson
Sent: Wednesday, June 16, 2010 3:39 PM
To: turnkey-mvs-***@public.gmane.org
Subject: Re: [turnkey-mvs] Cobol Select and Assign





what kind of magic is "UT-S-<my original name>"

Do I refer to them in runtime JCL as:

//DDREG DD DSN=HUDSON.DATA.DATA(CHKREG),DISP=SHR
//SYSPRINT DD SYSPRINT=A

??



On Wed, Jun 16, 2010 at 2:27 PM, Jean-Marie Bodin <jeanmarie.bodin-***@public.gmane.org>
wrote:



Hi



Try this



00007 INPUT-OUTPUT SECTION.
00008 FILE-CONTROL.
00009 SELECT REGISTER-FILE

00010 ASSIGN TO UT-S-DDREG.
00012 SELECT REPORT-FILE
00013 ASSIGN TO UT-S-SYSPRINT.

jm

----- Original Message -----

From: Ron Hudson <mailto:hudson.ra-***@public.gmane.org>

To: turnkey-mvs-***@public.gmane.org

Sent: Wednesday, June 16, 2010 8:17 PM

Subject: [turnkey-mvs] Cobol Select and Assign



Hi everyone,

I apologize to those I annoy - I have been Googling to try to find answers
and
basically only find frustration.


I thought this would be easier - a checkbook totaling program written in
cobol.

I want to read a file specified in my JCL and produce printed lines on the
printer.
I will also be reading a number from each record and keeping several sums.

Right now I am having problems specifying the file my program will interact
with. Also
the printer.

I have read all over the place, but I think most of what I have read
pertains to newer
versions of cobol.

00003 000700 ENVIRONMENT DIVISION.
00






00004 CONFIGURATION SECTION.


00005 000800 SOURCE-COMPUTER. IBM-370.
00


00006 000900 OBJECT-COMPUTER. IBM-370.
00







00007 INPUT-OUTPUT SECTION.


00008 FILE-CONTROL.


00009 SELECT REGISTER-FILE


00010 ASSIGN TO DDREG


00011 ORGANIZATION IS SEQUENTIAL.


00012 SELECT REPORT-FILE







00013 ASSIGN TO SYSPRINT.

And this is what cobol says about it....

CARD ERROR MESSAGE





11 IKF1155I-W DEVICE CLASS INVALID IN SYSTEM-NAME. SKIPPING TO NEXT
FIELD.






11 IKF1141I-W FILE ORGANIZATION FIELD INVALID IN SYSTEM-NAME.
SEQUENTIAL ASSUMED.


11 IKF1157I-E EXTERNAL-NAME NOT PRESENT IN SYSTEM-NAME.


11 IKF1017I-E IS INVALID IN SELECT CLAUSE. SKIPPING TO NEXT CLAUSE.







13 IKF1155I-W DEVICE CLASS INVALID IN SYSTEM-NAME. SKIPPING TO NEXT
FIELD.


13 IKF1141I-W FILE ORGANIZATION FIELD INVALID IN SYSTEM-NAME.
SEQUENTIAL ASSUMED.


13 IKF1157I-E EXTERNAL-NAME NOT PRESENT IN SYSTEM-NAME.







9 IKF2133I-W LABEL RECORDS CLAUSE MISSING. DD CARD OPTION WILL BE
TAKEN.




There are a bunch of other messages, but I think they are triggered by
these. I have tried several things
for both the register-file and the report-file (actually - the printer I
hope) instead of SYSPRINT I have had
PRINTER, and instead of DDREG I have had DISK and FILE.

Ron.
John R. Macdonald
2010-06-17 02:47:00 UTC
Permalink
Ron
The old (e.g. MVT) COBOL compilers used a system name in the SELECT statement which included: device class - organisation - DD name
SELECT SOMEFILE ASSIGN TO UT-S-DDNAME1
the device classes are:
UR for Unit Record (card reader/punch and printer devices)
UT for a UTility device (generally tape devices or PS disk)
DA for Direct Access devices
the organisation could have the following values:
S for sequential
D for direct access
I for ISAM (Indexed Sequential Access Method)
IIRC under DOS you could (or had to) specify the device number (2314, 2400, 1403 etc) after the device class. ==> SELECT SOMEFILE ASSIGN TO UT-2400-S-SYS010
I seem to remember the early DOS compilers needed this information but that was 40+ years ago.
Under the various incarnations of OS/360 it was not necessary.
The DD name of course links the actual file to the file in your program which leads to the next remarks I'd like to make concerning your JCL example
//DDREG DD DSN=HUDSON.DATA.-DATA(CHKREG)-,DISP=SHR
//SYSPRINT DD SYSPRINT=A
First I hope the "-DATA(CHKREG)-" is a typo
When writing a DD statement for an existing and catalogued input file I quickly learned it was more efficient to place the DISP parameter before the
DSN parameter especially when the length of the dataset name could frequently change as there was no need to rekey the DISP parameter.
//DDREG DD DISP=SHR,DSN=HUDSON.DATA.DATA(CHKREG) moving into acceptance or production
//DDREG DD DISP=SHR,DSN=HUDSON.DATA.TESTDATA(CHKREG) for instance or
//DDREG DD DISP=SHR,DSN=HUDSON.PRODUCTN.FY10DATA(CHKREG05)
(I won't go into using JCL symbols)
also coding only one parameter (or 2 max) per card image for longer statements helps in the long run

I don't really see the need to include 'DD' as part of the DDNAME as that doesn't really tell you anything you don't already know.
Some of the shops I've worked for had standards where your DDREG would have been IFREG (for Input File) or ISREG (Input Sequential) or similar
which helps when you're reading JCL you are not familiar with without peeking into the source program, as OS allows you to overwrite an existing
file if the JCL is setup that way.
For instance which is the input file and the output file?
//THISFILE DD DISP=OLD,DSN=DSNAME1
//SOMEFILE DD DISP=OLD,DSN=DSNAME2
contrast with
//OFFILE DD DISP=OLD,DSN=DSNAME1
//IFFILE DD DISP=OLD,DSN=DSNAME2

I know you are writing in COBOl but I don't recommend using SYSPRINT as a DDNAME. It is the standard output file for PL/I (COBOL uses SYSOUT) and
most utilities so if your COBOL program calls a PL/I subprogram you could end up with 'interesting' results.
It is also not very informative. A reader will guess it references printed output but which output? Your checkbook output or your run/error log?
//CHKREPRT DD SYSOUT=* for instance might be more useful to a (human) reader

Also the second SYSPRINT in your SYSPRINT statement is not a DD parameter. Your statement should read
//SYSPRINT DD SYSOUT=A

HTH
John


UT means a "unit record" device. S means sequential, as the second message assumed.



From: turnkey-mvs@-yahoogroups.-com [mailto:turnkey--***@yahoogroups.-com] On Behalf Of Ron Hudson
Sent: Wednesday, June 16, 2010 3:39 PM
To: turnkey-mvs@-yahoogroups.-com
Subject: Re: [turnkey-mvs] Cobol Select and Assign





what kind of magic is "UT-S-<my original name>"

Do I refer to them in runtime JCL as:

//DDREG DD DSN=HUDSON.DATA.-DATA(CHKREG)-,DISP=SHR
//SYSPRINT DD SYSPRINT=A

??



On Wed, Jun 16, 2010 at 2:27 PM, Jean-Marie Bodin <jeanmarie.bodin@ <mailto:jeanmarie.bodin-***@public.gmane.org> -free.fr> wrote:



Hi



Try this



00007 INPUT-OUTPUT SECTION.
00008 FILE-CONTROL.
00009 SELECT REGISTER-FILE

00010 ASSIGN TO UT-S-DDREG.
00012 SELECT REPORT-FILE
00013 ASSIGN TO UT-S-SYSPRINT.

jm

----- Original Message -----

From: Ron Hudson <mailto:hudson.ra-***@public.gmane.org>

To: turnkey-mvs@ <mailto:turnkey-mvs-***@public.gmane.org> -yahoogroups.-com

Sent: Wednesday, June 16, 2010 8:17 PM

Subject: [turnkey-mvs] Cobol Select and Assign



Hi everyone,

I apologize to those I annoy - I have been Googling to try to find answers and
basically only find frustration.


I thought this would be easier - a checkbook totaling program written in cobol.

I want to read a file specified in my JCL and produce printed lines on the printer.
I will also be reading a number from each record and keeping several sums.

Right now I am having problems specifying the file my program will interact with. Also
the printer.

I have read all over the place, but I think most of what I have read pertains to newer
versions of cobol.

00003 000700 ENVIRONMENT DIVISION. 00






00004 CONFIGURATION SECTION.


00005 000800 SOURCE-COMPUTER. IBM-370. 00


00006 000900 OBJECT-COMPUTER. IBM-370. 00







00007 INPUT-OUTPUT SECTION.


00008 FILE-CONTROL.


00009 SELECT REGISTER-FILE


00010 ASSIGN TO DDREG


00011 ORGANIZATION IS SEQUENTIAL.


00012 SELECT REPORT-FILE







00013 ASSIGN TO SYSPRINT.

And this is what cobol says about it....

CARD ERROR MESSAGE





11 IKF1155I-W DEVICE CLASS INVALID IN SYSTEM-NAME. SKIPPING TO NEXT FIELD.






11 IKF1141I-W FILE ORGANIZATION FIELD INVALID IN SYSTEM-NAME. SEQUENTIAL ASSUMED.


11 IKF1157I-E EXTERNAL-NAME NOT PRESENT IN SYSTEM-NAME.


11 IKF1017I-E IS INVALID IN SELECT CLAUSE. SKIPPING TO NEXT CLAUSE.







13 IKF1155I-W DEVICE CLASS INVALID IN SYSTEM-NAME. SKIPPING TO NEXT FIELD.


13 IKF1141I-W FILE ORGANIZATION FIELD INVALID IN SYSTEM-NAME. SEQUENTIAL ASSUMED.


13 IKF1157I-E EXTERNAL-NAME NOT PRESENT IN SYSTEM-NAME.







9 IKF2133I-W LABEL RECORDS CLAUSE MISSING. DD CARD OPTION WILL BE TAKEN.




There are a bunch of other messages, but I think they are triggered by these. I have tried several things
for both the register-file and the report-file (actually - the printer I hope) instead of SYSPRINT I have had
PRINTER, and instead of DDREG I have had DISK and FILE.

Ron.












No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.829 / Virus Database: 271.1.1/2940 - Release Date: 06/16/10 08:35:00
Ron Hudson
2010-06-17 03:26:38 UTC
Permalink
Thanks John..

Rick Fochtman
2010-06-17 01:13:43 UTC
Permalink
Ron, at the risk of sounding unpleasant, might I suggest you stick to
one language at a time? You may very well find yourself mixing languages
without intending to do so, and this will cause you no end of headaches.

I've never learned COBOL so I can't help you here.

Rick
-------------------------------------------------------------------------------
Post by Ron Hudson
<>
Hi everyone,
I apologize to those I annoy - I have been Googling to try to find
answers and
basically only find frustration.
I thought this would be easier - a checkbook totaling program written
in cobol.
I want to read a file specified in my JCL and produce printed lines on
the printer.
I will also be reading a number from each record and keeping several sums.
Right now I am having problems specifying the file my program will
interact with. Also
the printer.
I have read all over the place, but I think most of what I have read
pertains to newer
versions of cobol.
00003 000700 ENVIRONMENT DIVISION. 00
00004 CONFIGURATION SECTION.
00005 000800 SOURCE-COMPUTER. IBM-370. 00
00006 000900 OBJECT-COMPUTER. IBM-370. 00
00007 INPUT-OUTPUT SECTION.
00008 FILE-CONTROL.
00009 SELECT REGISTER-FILE
00010 ASSIGN TO DDREG
00011 ORGANIZATION IS SEQUENTIAL.
00012 SELECT REPORT-FILE
00013 ASSIGN TO SYSPRINT.
And this is what cobol says about it....
CARD ERROR MESSAGE
11 IKF1155I-W DEVICE CLASS INVALID IN SYSTEM-NAME. SKIPPING TO NEXT FIELD.
11 IKF1141I-W FILE ORGANIZATION FIELD INVALID IN SYSTEM-NAME. SEQUENTIAL ASSUMED.
11 IKF1157I-E EXTERNAL-NAME NOT PRESENT IN SYSTEM-NAME.
11 IKF1017I-E IS INVALID IN SELECT CLAUSE. SKIPPING TO NEXT CLAUSE.
13 IKF1155I-W DEVICE CLASS INVALID IN SYSTEM-NAME. SKIPPING TO NEXT FIELD.
13 IKF1141I-W FILE ORGANIZATION FIELD INVALID IN SYSTEM-NAME. SEQUENTIAL ASSUMED.
13 IKF1157I-E EXTERNAL-NAME NOT PRESENT IN SYSTEM-NAME.
9 IKF2133I-W LABEL RECORDS CLAUSE MISSING. DD CARD OPTION WILL BE TAKEN.
There are a bunch of other messages, but I think they are triggered by
these. I have tried several things
for both the register-file and the report-file (actually - the printer
I hope) instead of SYSPRINT I have had
PRINTER, and instead of DDREG I have had DISK and FILE.
Ron.
Continue reading on narkive:
Loading...