On 4/17/2012 4:04 PM, Tom Ross wrote:
On 4/16/2012 3:26 PM, McKown, John wrote:
If so, have you figured out how to specify a PDS as an "include" or
"copybook"source? The documentation for this command basically stinks.
There is an -I switch. But it apparently only accepts UNIX path
specifications.
The ld command (binder) accepts a PDS name via -L "//pds.name". The as
command
(HLASM) and C compilers accept a -I "//pds.name". I may end up writing
my own
version of the "cob2" command, if I really decide that I want to compile
COBOL
from the UNIX shell. I'll likely model it after the as command.
Yes. I discuss this command in our course "Developing Applications for
z/OS UNIX". But you're right, the doc is very poor. The assumption seems
to be that copy books must be in HFS directories and my experiments
produce error messages that would support that.
In a way, that's too bad. OTOH, I, too, was assuming that copy books
would reside in HFS directories so I had never tried to access copy
books as members of a PDS before.
You would think that if you used the classic clue that a library was
a PDS/E, the compiler could figure it out. Maybe:
export SYSLIB="//'SCOMSTO.U520.LIBRARY'"
which I tried, and the message from the compile comes back:
LineID Message code Library phase message text
24 IGYLI0049-S The "COPY" library "SCOMSTO.U520.LIBRARY/APODEFS"
was not
found. Skipped to the period terminating the
"COPY"
statement.
so it was pretty clearly expecting (nay: requiring) a z/OS UNIX
file, not a PDS.
I'm copying this over to ibm-main, too, as Tom Ross occasionally
follows that group so maybe he will chime in with some info.
Well, I actually ALWAYS follow this group, but via digest, so by
the time I see the COBOL questions someone on IBMMAIN has already
given the answer that I would have given! A perfect example is the
GO TO discussion where the poster did not use the "NOT AT END" phrase
of READ. Thank you listers for being so COBOL savvy!
On the topic of where your source can be for the cob2 command, it is
documented in the Programming Guide. It did take me a minute to
find it, but the location seems to make sense to me. In COBOL V4R2
version, see "Chapter 15. Compiling under z/OS UNIX", under the
heading "Setting environment variables under z/OS UNIX":
SYSLIB
Specify paths to directories to be used in searching for COBOL copybooks
if you do not specify an explicit library-name in the COPY statement.
Separate multiple paths with a colon. Paths are evaluated in order from the
first path to the last in the export command. If you set the variable with
multiple files of the same name, the first located copy of the file is used.
For COPY statements in which you have not coded an explicit library-name,
the compiler searches for copybooks in this order:
1. In the current directory
2. In the paths you specify with the -I cob2 option
3. In the paths you specify in the SYSLIB environment variable
It clearly says only directories and paths, but I suppose a confirmation
that datasets are not supported would be nice. I will try to get that into
the next version of the Programming Guide. If anyone has a better suggestion
for where this confirmation would go, let me know!
Cheers,
TomR>> COBOL is the Language of the Future!<<
So, in other words, you'll make the exclusion explicit instead of
removing the restriction. :-)
But, I gather from some of the discussions, and your comments, on
this list, you are rather tied up with other compiler priorities
these days.
Hope all is well.
--
Kind regards,
-Steve Comstock
The Trainer's Friend, Inc.
303-355-2752
http://www.trainersfriend.com
* To get a good Return on your Investment, first make an investment!
+ Training your people is an excellent investment
* Try our tool for calculating your Return On Investment
for training dollars at
http://www.trainersfriend.com/ROI/roi.html
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN