R.S. wrote:
Both questions regard COBOL
1. JCL EXEC ...,PARM='parameter'
Can I read data from PARM field in EXEC statement ?
Any ACCEPT ?
2. Dynamic allocation
Can I use permanent dataset without DDNAME ?
In other words can I specify dataset name instead of ddname ?
I see you got a nice clear answer to your first question.
For the second, you can take advantage of dynamic allocation
in the following manner:
* Code a SELECT and an FD as usual.
say:
select persnnl assign to people.
.
.
.
fd persnnl
.
.
.
* Declare as constants the dataset name
and allocation type (say, SHR) (or, you
can build it dynamically); the syntax
is in the Programmer's Guide; this should
be in a null-terminated string
say:
02 file-name.
03 pic x(12) value 'PEOPLE=DSN('.
03 dsname pic x(60) value spaces.
03 pic xx value z' '.
-at run time you can get the value for
"dsname" from a parm or other source;
add a closing paren and your disposition
say:
string in-name delimited by space
') SHR ' delimited by size into dsname
* set a pointer to the constructed string
say:
set file-ptr to address of file-name
* call putenv()
say:
call 'putenv' using by value file-ptr returning rc
where 'rc' is a fullword binary integer; if the value in
rc is -1 after the call, the putenv failed.
You can now open your file. Be sure to _omit_ a DD
statement for your file at run time. It's the
absence of a DD statement that causes COBOL to
look for an evironment variable with the same
name as your DDname.
<ad>
All this (and much, much more) is discussed (with a
chance for hands on lab) in our three day course
"Advanced Topics in COBOL (Enterprise COBOL, z/OS)"
details:
http://www.trainersfriend.com/COBOL_Courses/D725descrpt.htm
</ad>
HTH.
Kind regards,
-Steve Comstock
The Trainer's Friend, Inc.
303-393-8716
http://www.trainersfriend.com
z/OS Application development made easier
* Our classes include
+ How things work
+ Programming examples with realistic applications
+ Starter / skeleton code
+ Complete working programs
+ Useful utilities and subroutines
+ Tips and techniques
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html