Re: Two COBOL questions

2008-02-13 Thread McKown, John
> -Original Message-
> From: IBM Mainframe Discussion List 
> [mailto:[EMAIL PROTECTED] On Behalf Of Tom Ross
> Sent: Tuesday, February 12, 2008 12:15 PM
> To: IBM-MAIN@BAMA.UA.EDU
> Subject: Re: Two COBOL questions
> 
> 
> >I think you have a bug in your call to CEEENV. You have:
> >
> >>  call 'ceeenv' using update-req, six, file-name,
> >>   val-length, val-ptr, fc
> >
> >call 'ceeenv' using update-req, six, file-name,
> >   val-length, env-val, fc
> >
> 
> John,
> 
>   Steve is right, his example is correct and yours is not.
> LE wants an address of an address of the env var value.
> The LE books says the environment name should also be an
> address of an address but the books are wrong.  I will get
> them fixed.  I was just coding calls to CEEENV to update
> my SHARE presentation 'Got COBOL' yesterday and running
> tests on this very service!
> 
> Cheers,
> TomR  >> COBOL is the Language of the Future! <<

Thanks. I guess I trust the manuals too much.

--
John McKown
Senior Systems Programmer
HealthMarkets
Keeping the Promise of Affordable Coverage
Administrative Services Group
Information Technology

The information contained in this e-mail message may be privileged
and/or confidential.  It is for intended addressee(s) only.  If you are
not the intended recipient, you are hereby notified that any disclosure,
reproduction, distribution or other use of this communication is
strictly prohibited and could, in certain circumstances, be a criminal
offense.  If you have received this e-mail in error, please notify the
sender by reply and delete this message without copying or disclosing
it. 

--
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


Re: Two COBOL questions

2008-02-12 Thread Tom Ross
>I think you have a bug in your call to CEEENV. You have:
>
>>  call 'ceeenv' using update-req, six, file-name,
>>   val-length, val-ptr, fc
>
>call 'ceeenv' using update-req, six, file-name,
>   val-length, env-val, fc
>

John,

  Steve is right, his example is correct and yours is not.
LE wants an address of an address of the env var value.
The LE books says the environment name should also be an
address of an address but the books are wrong.  I will get
them fixed.  I was just coding calls to CEEENV to update
my SHARE presentation 'Got COBOL' yesterday and running
tests on this very service!

Cheers,
TomR  >> COBOL is the Language of the Future! <<

--
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


Re: Two COBOL questions

2008-02-11 Thread Elardus Engelbrecht
McKown, John wrote:

>I don't think that CEEENV uses UNIX system services. But, then, I don't
>think that BPXWDYN calls UNIX functions either. I think it is prefixed
>with BPX... simply so that people feel comfortable using it in a UNIX
>shell script or program.
>
>In either case, eventually they end up calling SVC 99 to do the real
>allocation. Well, actually CEEENV doesn't call SVC 99, some part of
>COBOL does.

It is obvious, you didn't see my reply using BPXWDYN or read up on 
BPXWDYN...

You're also discussing about release depedency. BPXWDYN is available since 
z/OS v1.4. 

CEEENV is another set of services in Language Environment.

>From 'Using REXX and z/OS UNIX System Services ':
 
BPXWDYN is a text interface to a subset of the SVC 99 (dynamic allocation) 
and SVC 109 (dynamic output) services. BPXWDYN supports data set 
allocation, unallocation, concatenation, the retrieval of certain allocation 
information, and the addition and deletion of output descriptors. BPXWDYN is 
designed to be called from REXX, but it may be called from several other 
programming languages, including Assembler, C, and PL/I.

This interface makes dynamic allocation and dynamic output services easily 
accessible to programs running outside of a TSO environment; however, it also 
functions in a TSO environment.

Groete / Greetings

Elardus Engelbrecht

--
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


Re: Two COBOL questions

2008-02-11 Thread McKown, John
> -Original Message-
> From: IBM Mainframe Discussion List 
> [mailto:[EMAIL PROTECTED] On Behalf Of Scott Ford
> Sent: Monday, February 11, 2008 2:29 PM
> To: IBM-MAIN@BAMA.UA.EDU
> Subject: Re: Two COBOL questions
> 
> 
> John,
> 
> Isn't this similar or the same as BPXWDYNcall to USS...
> 
> Regards,
> Scott
> IDF

I don't think that CEEENV uses UNIX system services. But, then, I don't
think that BPXWDYN calls UNIX functions either. I think it is prefixed
with BPX... simply so that people feel comfortable using it in a UNIX
shell script or program.

In either case, eventually they end up calling SVC 99 to do the real
allocation. Well, actually CEEENV doesn't call SVC 99, some part of
COBOL does.

--
John McKown
Senior Systems Programmer
HealthMarkets
Keeping the Promise of Affordable Coverage
Administrative Services Group
Information Technology

The information contained in this e-mail message may be privileged
and/or confidential.  It is for intended addressee(s) only.  If you are
not the intended recipient, you are hereby notified that any disclosure,
reproduction, distribution or other use of this communication is
strictly prohibited and could, in certain circumstances, be a criminal
offense.  If you have received this e-mail in error, please notify the
sender by reply and delete this message without copying or disclosing
it. 

--
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


Re: Two COBOL questions

2008-02-11 Thread Scott Ford
John,

Isn't this similar or the same as BPXWDYNcall to USS...

Regards,
Scott
IDF

-Original Message-
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf
Of McKown, John
Sent: Monday, February 11, 2008 3:20 PM
To: IBM-MAIN@BAMA.UA.EDU
Subject: Re: Two COBOL questions

> -Original Message-
> From: IBM Mainframe Discussion List 
> [mailto:[EMAIL PROTECTED] On Behalf Of Steve Comstock
> Sent: Monday, February 11, 2008 2:02 PM
> To: IBM-MAIN@BAMA.UA.EDU
> Subject: Re: Two COBOL questions
> 

[snip]

> 2. Using a call to ceeenv:
> 
> select persnnl assign to people.
> ...
> 01 file-stuff.
> 02 update-req pic s9(9) binary value 5.
> 02 six pic s9(9) binary value 6.
> 02 file-name pic x(6) value 'PEOPLE'.
> 02 val-length pic s9(9) binary value 64.
> 02 val-ptr pointer.
> 02 env-val
>03 pic x(4) value 'DSN('.
>03 dsname pic x(60) value spaces.
> 02 fc pic x(12) value low-values.
> ...
> linkage section.
> 01 in-name pic x(55).
> 
> procedure division using in-name.
>  string in-name delimited by space
>  ') SHR ' delimited by size into dsname
>  set val-ptr to address of env-val

I think you have a bug in your call to CEEENV. You have:

>  call 'ceeenv' using update-req, six, file-name,
>   val-length, val-ptr, fc

call 'ceeenv' using update-req, six, file-name,
   val-length, env-val, fc

>  if fc = low-values
>continue
>  else
>display 'Setting environment variable failed'
>stop run
>  endif
>  open input persnnl
> 
> -
> 
> You decide.

Either is OK by me. The compatability with pre-z/OS 1.8 environment
suggest that putenv() might be best for now.

> 
> 
> Kind regards,
> 
> -Steve Comstock
> The Trainer's Friend, Inc.

--
John McKown
Senior Systems Programmer
HealthMarkets
Keeping the Promise of Affordable Coverage
Administrative Services Group
Information Technology

The information contained in this e-mail message may be privileged
and/or confidential.  It is for intended addressee(s) only.  If you are
not the intended recipient, you are hereby notified that any disclosure,
reproduction, distribution or other use of this communication is
strictly prohibited and could, in certain circumstances, be a criminal
offense.  If you have received this e-mail in error, please notify the
sender by reply and delete this message without copying or disclosing
it. 

--
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

--
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


Re: Two COBOL questions

2008-02-11 Thread McKown, John
> -Original Message-
> From: IBM Mainframe Discussion List 
> [mailto:[EMAIL PROTECTED] On Behalf Of Steve Comstock
> Sent: Monday, February 11, 2008 2:02 PM
> To: IBM-MAIN@BAMA.UA.EDU
> Subject: Re: Two COBOL questions
> 

[snip]

> 2. Using a call to ceeenv:
> 
> select persnnl assign to people.
> ...
> 01 file-stuff.
> 02 update-req pic s9(9) binary value 5.
> 02 six pic s9(9) binary value 6.
> 02 file-name pic x(6) value 'PEOPLE'.
> 02 val-length pic s9(9) binary value 64.
> 02 val-ptr pointer.
> 02 env-val
>03 pic x(4) value 'DSN('.
>03 dsname pic x(60) value spaces.
> 02 fc pic x(12) value low-values.
> ...
> linkage section.
> 01 in-name pic x(55).
> 
> procedure division using in-name.
>  string in-name delimited by space
>  ') SHR ' delimited by size into dsname
>  set val-ptr to address of env-val

I think you have a bug in your call to CEEENV. You have:

>  call 'ceeenv' using update-req, six, file-name,
>   val-length, val-ptr, fc

call 'ceeenv' using update-req, six, file-name,
   val-length, env-val, fc

>  if fc = low-values
>continue
>  else
>display 'Setting environment variable failed'
>stop run
>  endif
>  open input persnnl
> 
> -
> 
> You decide.

Either is OK by me. The compatability with pre-z/OS 1.8 environment
suggest that putenv() might be best for now.

> 
> 
> Kind regards,
> 
> -Steve Comstock
> The Trainer's Friend, Inc.

--
John McKown
Senior Systems Programmer
HealthMarkets
Keeping the Promise of Affordable Coverage
Administrative Services Group
Information Technology

The information contained in this e-mail message may be privileged
and/or confidential.  It is for intended addressee(s) only.  If you are
not the intended recipient, you are hereby notified that any disclosure,
reproduction, distribution or other use of this communication is
strictly prohibited and could, in certain circumstances, be a criminal
offense.  If you have received this e-mail in error, please notify the
sender by reply and delete this message without copying or disclosing
it. 

--
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


Re: Two COBOL questions

2008-02-11 Thread Steve Comstock

McKown, John wrote:

-Original Message-
From: IBM Mainframe Discussion List 
[mailto:[EMAIL PROTECTED] On Behalf Of Steve Comstock

Sent: Friday, February 08, 2008 7:04 AM
To: IBM-MAIN@BAMA.UA.EDU
Subject: Re: Two COBOL questions



[snip]



  call 'putenv' using by value file-ptr returning rc



[snip]



Kind regards,

-Steve Comstock
The Trainer's Friend, Inc.



Easier to use CEEENV than calling the C subroutine putenv(), IMO.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/CEEA3180/2.2.
5.34


Actually, I went back and tried some code; here's
my results:

1. Using a call to putenv():

select persnnl assign to people.
...
01 file-stuff.
   02 file-ptr pointer.
   02 file-name.
  03 pic x(12) value 'PEOPLE=DSN('.
  03 dsname pic x(60) value spaces.
  03 pic xx value z' '.
   02 rc pic s9(9) binary value 0.
...
linkage section.
01 in-name pic x(55).

procedure division using in-name.
string in-name delimited by space
') SHR ' delimited by size into dsname
set file-ptr to address of file-name
call 'putenv' using by value file-ptr returning rc
if rc = -1
  continue
else
  display 'Setting environment variable failed'
  stop run
endif
open input persnnl

-

2. Using a call to ceeenv:

select persnnl assign to people.
...
01 file-stuff.
   02 update-req pic s9(9) binary value 5.
   02 six pic s9(9) binary value 6.
   02 file-name pic x(6) value 'PEOPLE'.
   02 val-length pic s9(9) binary value 64.
   02 val-ptr pointer.
   02 env-val
  03 pic x(4) value 'DSN('.
  03 dsname pic x(60) value spaces.
   02 fc pic x(12) value low-values.
...
linkage section.
01 in-name pic x(55).

procedure division using in-name.
string in-name delimited by space
') SHR ' delimited by size into dsname
set val-ptr to address of env-val
call 'ceeenv' using update-req, six, file-name,
 val-length, val-ptr, fc
if fc = low-values
  continue
else
  display 'Setting environment variable failed'
  stop run
endif
open input persnnl

-

You decide.


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


Re: Two COBOL questions

2008-02-08 Thread Steve Comstock

McKown, John wrote:

-Original Message-
From: IBM Mainframe Discussion List 
[mailto:[EMAIL PROTECTED] On Behalf Of Steve Comstock

Sent: Friday, February 08, 2008 7:04 AM
To: IBM-MAIN@BAMA.UA.EDU
Subject: Re: Two COBOL questions



[snip]



  call 'putenv' using by value file-ptr returning rc



[snip]



Kind regards,

-Steve Comstock
The Trainer's Friend, Inc.



Easier to use CEEENV than calling the C subroutine putenv(), IMO.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/CEEA3180/2.2.
5.34


I agree it's easier. But it's only available in z/OS 1.8
and later; so that's why I recommend putenv(): that's been
available for a lot longer.


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


Two COBOL questions

2008-02-08 Thread Bill Klein
Lots of replies - with varying degrees of accuracy and current COBOL support
usefulness.  However, both of these are easy and well documented in current
native COBOL.

For getting the PARM string (no matter its length), use the LE callable
service CEE3PR2. See:
 
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/CEEA3180/2.2.5.17


(This avoids issues with 100 byte strings and CBLOPTS run-time option
setting).

  ***

For dynamic allocation (all types of files, QSAM, VSAM, Line sequential),
etc, do use COBOL Dynamic Allocation facilities.  See:
  http://publibfp.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/igy3lr40/4.2.3.1 

and its following section as well as:
  http://publibfp.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/igy3pg40/1.8.3 

NOTE:
  The COBOL samples still use "putenv" - but I would agree with the
suggestion that you use CEEENV instead.  See:
 
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/CEEA3180/2.2.5.34


 

"R.S." <[EMAIL PROTECTED]> wrote in message
news:<[EMAIL PROTECTED]>...
> 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 ?
> 
> -- 
> Radoslaw Skorupka
> Lodz, Poland
> 
> 
> --
> BRE Bank SA
> ul. Senatorska 18
> 00-950 Warszawa
> www.brebank.pl
> 
> Sad Rejonowy dla m. st. Warszawy 
> XII Wydzial Gospodarczy Krajowego Rejestru Sadowego, 
> nr rejestru przedsiebiorców KRS 025237
> NIP: 526-021-50-88
> Wedlug stanu na dzien 01.01.2007 r. kapital zakladowy BRE Banku SA (w
calosci oplacony) wynosi 118.064.140 zl. W zwiazku z realizacja warunkowego
podwyzszenia kapitalu zakladowego, na podstawie uchwal XVI WZ z dnia
21.05.2003 r., kapital zakladowy BRE Banku SA moze ulec podwyzszeniu do
kwoty 118.760.528 zl. Akcje w podwyzszonym kapitale zakladowym beda w
calosci oplacone.
> 
> --
> 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

--
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


Re: Two COBOL questions

2008-02-08 Thread Scott Ford
Darren,
Yes you can I do it all the time, Do you want an example..??

Regards,
Scott Ford
IDF



-Original Message-
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf
Of GAVIN Darren * OPS EAS
Sent: Friday, February 08, 2008 11:40 AM
To: IBM-MAIN@BAMA.UA.EDU
Subject: Re: Two COBOL questions

You can pass the File-Name itself on a call to a subprogram, and this will
expose the FCB to the subprogram, however I would guess this is protected
storage and wouldn't let the program change any of the values.

As it doesn't expose the DCB I don't think you could use this to dynamically
change the DD and Dataset around, even if the FCB is alterable.  To be
honest I haven't played around with this; just know that it's available in
the later releases of COBOL.

Darren


-Original Message-
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf
Of R.S.
Sent: Friday, February 08, 2008 2:18 AM
To: IBM-MAIN@BAMA.UA.EDU
Subject: Two COBOL questions

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 ?

-- 
Radoslaw Skorupka
Lodz, Poland


--
BRE Bank SA
ul. Senatorska 18
00-950 Warszawa
www.brebank.pl

Sąd Rejonowy dla m. st. Warszawy 
XII Wydział Gospodarczy Krajowego Rejestru Sądowego, 
nr rejestru przedsiębiorców KRS 025237
NIP: 526-021-50-88
Według stanu na dzień 01.01.2007 r. kapitał zakładowy BRE Banku SA (w
całości opłacony) wynosi 118.064.140 zł. W związku z realizacją warunkowego
podwyższenia kapitału zakładowego, na podstawie uchwał XVI WZ z dnia
21.05.2003 r., kapitał zakładowy BRE Banku SA może ulec podwyższeniu do
kwoty 118.760.528 zł. Akcje w podwyższonym kapitale zakładowym będą w
całości opłacone.

--
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

--
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

--
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


Re: SPAM: Two COBOL questions

2008-02-08 Thread Rick Fochtman

--:


Both questions regard COBOL

1. JCL EXEC ...,PARM='parameter'
Can I read data from PARM field in EXEC statement ?
Any ACCEPT ?


-
Can't answer; never learned COBOL.

--


2. Dynamic allocation
Can I use permanent dataset without DDNAME ?
In other words can I specify dataset name instead of ddname ?


-
No. But you CAN make use of the DYNAM subroutine, from the CBT site. 
Works very well.


--
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


Re: Two COBOL questions

2008-02-08 Thread GAVIN Darren * OPS EAS
You can pass the File-Name itself on a call to a subprogram, and this will 
expose the FCB to the subprogram, however I would guess this is protected 
storage and wouldn't let the program change any of the values.

As it doesn't expose the DCB I don't think you could use this to dynamically 
change the DD and Dataset around, even if the FCB is alterable.  To be honest I 
haven't played around with this; just know that it's available in the later 
releases of COBOL.

Darren


-Original Message-
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf Of R.S.
Sent: Friday, February 08, 2008 2:18 AM
To: IBM-MAIN@BAMA.UA.EDU
Subject: Two COBOL questions

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 ?

-- 
Radoslaw Skorupka
Lodz, Poland


--
BRE Bank SA
ul. Senatorska 18
00-950 Warszawa
www.brebank.pl

Sąd Rejonowy dla m. st. Warszawy 
XII Wydział Gospodarczy Krajowego Rejestru Sądowego, 
nr rejestru przedsiębiorców KRS 025237
NIP: 526-021-50-88
Według stanu na dzień 01.01.2007 r. kapitał zakładowy BRE Banku SA (w całości 
opłacony) wynosi 118.064.140 zł. W związku z realizacją warunkowego 
podwyższenia kapitału zakładowego, na podstawie uchwał XVI WZ z dnia 21.05.2003 
r., kapitał zakładowy BRE Banku SA może ulec podwyższeniu do kwoty 118.760.528 
zł. Akcje w podwyższonym kapitale zakładowym będą w całości opłacone.

--
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

--
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


Re: Two COBOL questions

2008-02-08 Thread McKown, John
Oh, I forgot the CEEOPTS DD statememt for specifying LE options. You can
use that if you need to exceed the 120 character PARM= length.

//CEEOPTS DD *
ENVAR('DD1=DSN(MY.SEQ.DSN) SHR','DD2=DSN(MY.PDS(MEMBER)) SHR')
/*

--
John McKown
Senior Systems Programmer
HealthMarkets
Keeping the Promise of Affordable Coverage
Administrative Services Group
Information Technology

The information contained in this e-mail message may be privileged
and/or confidential.  It is for intended addressee(s) only.  If you are
not the intended recipient, you are hereby notified that any disclosure,
reproduction, distribution or other use of this communication is
strictly prohibited and could, in certain circumstances, be a criminal
offense.  If you have received this e-mail in error, please notify the
sender by reply and delete this message without copying or disclosing
it. 

--
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


Re: Two COBOL questions

2008-02-08 Thread McKown, John
> -Original Message-
> From: IBM Mainframe Discussion List 
> [mailto:[EMAIL PROTECTED] On Behalf Of Steve Comstock
> Sent: Friday, February 08, 2008 7:04 AM
> To: IBM-MAIN@BAMA.UA.EDU
> Subject: Re: Two COBOL questions

[snip]

> 
>call 'putenv' using by value file-ptr returning rc

[snip]

> 
> Kind regards,
> 
> -Steve Comstock
> The Trainer's Friend, Inc.

Easier to use CEEENV than calling the C subroutine putenv(), IMO.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/CEEA3180/2.2.
5.34

--
John McKown
Senior Systems Programmer
HealthMarkets
Keeping the Promise of Affordable Coverage
Administrative Services Group
Information Technology

The information contained in this e-mail message may be privileged
and/or confidential.  It is for intended addressee(s) only.  If you are
not the intended recipient, you are hereby notified that any disclosure,
reproduction, distribution or other use of this communication is
strictly prohibited and could, in certain circumstances, be a criminal
offense.  If you have received this e-mail in error, please notify the
sender by reply and delete this message without copying or disclosing
it. 

--
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


Re: Two COBOL questions

2008-02-08 Thread McKown, John
> -Original Message-
> From: IBM Mainframe Discussion List 
> [mailto:[EMAIL PROTECTED] On Behalf Of R.S.
> Sent: Friday, February 08, 2008 4:18 AM
> To: IBM-MAIN@BAMA.UA.EDU
> Subject: Two COBOL questions
> 
> 
> Both questions regard COBOL
> 
> 1. JCL EXEC ...,PARM='parameter'
> Can I read data from PARM field in EXEC statement ?

Yes.

> Any ACCEPT ?

No.

OK, some example code that I have:


LOCAL-STORAGE SECTION.
01  USABLE-PARM PIC X(120).

LINKAGE SECTION.
01  MVS-PARM.
05  MVS-PARM-LENGTH   PIC S999 USAGE BINARY.
05  MVS-PARM-VALUEPIC X(120) .

...

PROCEDURE DIVISION USING MVS-PARM.
MOVE SPACES TO USABLE-PARM.
IF MVS-PARM-LENGTH > 0 THEN 
MOVE MVS-PARM-VALUE(1:MVS-PARM-LENGTH) TO USABLE-PARM.
   END-IF


> 
> 2. Dynamic allocation
> Can I use permanent dataset without DDNAME ?

Yes.

> In other words can I specify dataset name instead of ddname ?

Yes.

Enterprise COBOL allows for dynamic allocation of files. Use the FD and
ASSIGN as you currently do. Do not include a DD. Instead, before doing
the OPEN, set an environment variable to contain the necessary
information, including the DSN.

Reference on the ASSIGN in COBOL.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3LR31/4.2.
3

How to set an environment variable using Language Environment:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/CEEA3170/2.2.
5.31


Note also that you can use the ENVAR LE parameter in the PARM= on the
EXEC.

Curiousity: why do you want to do this?

> 
> -- 
> Radoslaw Skorupka
> Lodz, Poland



--
John McKown
Senior Systems Programmer
HealthMarkets
Keeping the Promise of Affordable Coverage
Administrative Services Group
Information Technology

The information contained in this e-mail message may be privileged
and/or confidential.  It is for intended addressee(s) only.  If you are
not the intended recipient, you are hereby notified that any disclosure,
reproduction, distribution or other use of this communication is
strictly prohibited and could, in certain circumstances, be a criminal
offense.  If you have received this e-mail in error, please notify the
sender by reply and delete this message without copying or disclosing
it. 

--
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


Re: Two COBOL questions

2008-02-08 Thread Steve Comstock

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.





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




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


Re: Two COBOL questions

2008-02-08 Thread David Logan
Sure, but you can have DYNALLOC do either of two things:
(1) You specify your own DD name, or
(2) Allow DYNALLOC to generate the DD name for you

Because COBOL likes static DD names, you can specify the dataset name, and
ask it to relate it to a DD name that you then specify in your FD.

David Logan

-Original Message-
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf
Of Ganesh Rao
Sent: Friday, February 08, 2008 6:03 AM
To: IBM-MAIN@BAMA.UA.EDU
Subject: Re: Two COBOL questions

David, Even if it is ASM, would he not need the DD to read a permanent 
dataset ?

He can still use a constant DD in COBOL and do dynalloc using bpxwdyn, 
putenv or TSO ALLOC against the dataset, then read that DD, correct ?

-Gani


On Fri, 8 Feb 2008 05:39:18 -0700, David Logan <[EMAIL PROTECTED]> 
wrote:

>Per question #2, look up DYNALLOC. I don't know if there are any COBOL
calls
>for it, but you can write a routine in C/C++, PLI, ASM or just about any
>other language to make an SVC 99 call.
>
>David Logan
>

--
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

--
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


Re: Two COBOL questions

2008-02-08 Thread Elardus Engelbrecht
R.S. wrote:

>Both questions regard COBOL
>
>1. JCL EXEC ...,PARM='parameter'
>Can I read data from PARM field in EXEC statement ?
>Any ACCEPT ?

Yes! This example accept a numeric parameter of 2 digits. This example is 
used to accept a number 1-12 (month) and give a RC based on input. If no 
parameter are supplied or is incorrect the current month is returned.


LINKAGE SECTION.
01  W2-PARAM.   
03  W2-PARAM-TEL PIC S9(4) COMP.
03  W2-PARAM-MM  PIC 99.

PROCEDURE DIVISION  
  USING W2-PARAM.   

BEGIN.   
IF (W2-PARAM-TEL NOT = 2) OR  
   (W2-PARAM-MM < 0) OR (W2-PARAM-MM > 12)
  MOVE FUNCTION CURRENT-DATE(1:8) TO W1-DATUM 
  MOVE W1-MM TO RETURN-CODE   
  DISPLAY 'W1-MM : '  
  W1-MMUPON OUTSYS
   ELSE   
  DISPLAY 'RC FROM CURRENT DATE: ' 
  W2-PARAM-MM UPON OUTSYS 
  MOVE W2-PARAM-MM TO RETURN-CODE.
STOP RUN. 


>2. Dynamic allocation
>Can I use permanent dataset without DDNAME ?
>In other words can I specify dataset name instead of ddname ?

Yes!! Of COURSE! Look up BPXWDYN.


WORKING-STORAGE SECTION. 
01  SUB-PGM   PIC X(8)   VALUE 'BPXWDYN '.   
01  ALLOC-INVOER-CMD.
05  FILLERPIC X(50)  VALUE   
' ALLOC DD(FILEIN) DSN(COBOL.DYNALLOC) OLD '.
05  FILLERPIC X(50)  VALUE   
'  '.

01 COMMAND-STRING.  
05 C-S-LENPIC S9(4)   BINARY VALUE +100.
05 C-S-DATA.
07 FILLER PIC X(100).   

MOVE ALLOC-INVOER-CMD TO C-S-DATA. 
CALL SUB-PGM USING COMMAND-STRING. 

Groete / Greetings

Elardus Engelbrecht

--
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


Re: Two COBOL questions

2008-02-08 Thread Ganesh Rao
David, Even if it is ASM, would he not need the DD to read a permanent 
dataset ?

He can still use a constant DD in COBOL and do dynalloc using bpxwdyn, 
putenv or TSO ALLOC against the dataset, then read that DD, correct ?

-Gani


On Fri, 8 Feb 2008 05:39:18 -0700, David Logan <[EMAIL PROTECTED]> 
wrote:

>Per question #2, look up DYNALLOC. I don't know if there are any COBOL calls
>for it, but you can write a routine in C/C++, PLI, ASM or just about any
>other language to make an SVC 99 call.
>
>David Logan
>

--
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


Re: Two COBOL questions

2008-02-08 Thread David Logan
Per question #2, look up DYNALLOC. I don't know if there are any COBOL calls
for it, but you can write a routine in C/C++, PLI, ASM or just about any
other language to make an SVC 99 call.

David Logan

-Original Message-
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf
Of Michael Knigge
Sent: Friday, February 08, 2008 3:45 AM
To: IBM-MAIN@BAMA.UA.EDU
Subject: Re: Two COBOL questions

R.,

> 1. JCL EXEC ...,PARM='parameter'
> Can I read data from PARM field in EXEC statement ?
> Any ACCEPT ?

It is accessible from the LINKAGE-SECTION:

LINKAGE SECTION.
01  PARM.
 05  PARM-LENGTHPIC 9(4)   COMP.
 05  PARM-STRINGPIC X(999).

PROCEDURE DIVISION USING PARM.
A00-BEGINN.
 DISPLAY 'PARM IS ' PARM-LENGTH ' BYTES LONG'
 DISPLAY 'PARM=' PARM-STRING(1:PARM-LENGTH)



> 2. Dynamic allocation
> Can I use permanent dataset without DDNAME ?
> In other words can I specify dataset name instead of ddname ?

AFAIK, no.


Bye,
Michael

--
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

--
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


Re: Two COBOL questions

2008-02-08 Thread Michael Knigge

R.,


1. JCL EXEC ...,PARM='parameter'
Can I read data from PARM field in EXEC statement ?
Any ACCEPT ?


It is accessible from the LINKAGE-SECTION:

LINKAGE SECTION.
01  PARM.
05  PARM-LENGTHPIC 9(4)   COMP.
05  PARM-STRINGPIC X(999).

PROCEDURE DIVISION USING PARM.
A00-BEGINN.
DISPLAY 'PARM IS ' PARM-LENGTH ' BYTES LONG'
DISPLAY 'PARM=' PARM-STRING(1:PARM-LENGTH)




2. Dynamic allocation
Can I use permanent dataset without DDNAME ?
In other words can I specify dataset name instead of ddname ?


AFAIK, no.


Bye,
Michael

--
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


Two COBOL questions

2008-02-08 Thread R.S.

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 ?

--
Radoslaw Skorupka
Lodz, Poland


--
BRE Bank SA
ul. Senatorska 18
00-950 Warszawa
www.brebank.pl

Sąd Rejonowy dla m. st. Warszawy 
XII Wydział Gospodarczy Krajowego Rejestru Sądowego, 
nr rejestru przedsiębiorców KRS 025237

NIP: 526-021-50-88
Według stanu na dzień 01.01.2007 r. kapitał zakładowy BRE Banku SA (w całości 
opłacony) wynosi 118.064.140 zł. W związku z realizacją warunkowego 
podwyższenia kapitału zakładowego, na podstawie uchwał XVI WZ z dnia 21.05.2003 
r., kapitał zakładowy BRE Banku SA może ulec podwyższeniu do kwoty 118.760.528 
zł. Akcje w podwyższonym kapitale zakładowym będą w całości opłacone.

--
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