View previous topic :: View next topic
|
Author |
Message |
Klaus
New User
Joined: 05 Oct 2006 Posts: 4 Location: Europe- Cologne
|
|
|
|
Hi all!
I am trying to allocate an GDG dataset within a COBOL stored procedure, without using JCL. The GDG base is already defined.
The new allocated dataset is supposed to be used for WRITE access in the same stored procedure.
Does anyone have experience with stored procs which use BPXWDYN, or any similar pgm?
A sample of a valid stored proc, which defines and uses a new GDG dataset woul be very much appreciated.
I tried without success to use the samples I found in the forum, as they are refferring to existing datasets.
Thanks,
Klaus |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
If you run under TSO, you can use the ALLOCATE command from within COBOL.
O. |
|
Back to top |
|
|
Klaus
New User
Joined: 05 Oct 2006 Posts: 4 Location: Europe- Cologne
|
|
|
|
Sorry, I forgot to mention, that I need to allocate the file dynamically. I do not know whether in this cas I can use the ALLOCATE command.
Regards
Klaus |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Why not?
O. |
|
Back to top |
|
|
Klaus
New User
Joined: 05 Oct 2006 Posts: 4 Location: Europe- Cologne
|
|
|
|
Sory, but I am not aware of any ALLOCATE command within COBOL.
Klaus |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Quote: |
COBOL stored procedure |
would You be so kind to explain what You mean by the quoted sentence ?? |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
enrico -
He probably means DB2 stored procedure.
O. |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
I found on this forum how to call a rexx or clist from cobol to dynamically allocate datasets.
First CALL IKJTSOEV to setup the TSO environment then CALL IKJEFTSR to run your REXX or clist. Search this forum to get the details and code. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Douglas - Using these services, one can issue the ALLOCATE command (or any TSO comand) directly from within COBOL.
O. |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
Yes, It is true you can execute an ALLOCATE or any other TSO command from COBOL this way. In my case it simplified the COBOL program to execute a REXX that could execute multiple TSO commands and choose subparameter values instead of coding them each into the COBOL program. |
|
Back to top |
|
|
Klaus
New User
Joined: 05 Oct 2006 Posts: 4 Location: Europe- Cologne
|
|
|
|
Hello everyone,
thank you for your hints, I'l try to use ALLOCATE.
Regards
Klaus |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Klause,
I've not used ALLOC for creating GDGs, but it looks like you must provide the full DSN (w/the G/V extension).
That could be a problem unless you use LISTCAT, but even there it's possible someone can create a new generation in the time between the LISTCAT and the ALLOC. |
|
Back to top |
|
|
|