472,326 Members | 2,218 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,326 software developers and data experts.

Stored Procedures in OS/390 V6

This question relates to DB2 Version 6 on OS/390.

Can a (COBOL) stored procedure on this platform do file I/O, i.e. write to a
sequential file?

I am trying to debug a stored procedure. As far as I know, DB2 stored
procedures cannot do terminal I/O on any operating system but I know that
(Java) stored procedures in Windows/Linux/Unix can write to files and I have
done this many times.

I am trying to do the same thing in OS/390 but nothing is getting written to
my file. As a result, I can't tell if the client is failing to get into the
stored procedure or not. Maybe it is getting into the stored proc just fine
but COBOL stored procs in OS/390 can't do file I/O, unlike the case in
Windows.

Unfortunately, I haven't yet found anything in the manuals I've consulted to
say one way or the other if COBOL stored procs can do file I/O in DB2 V6 on
OS/390.

Can anyone clarify if I can do file I/O in my circumstances? I really just
want to write a few lines *somewhere* so that I can verify that the stored
proc was entered and what happened when it was there.

Rhino
Nov 12 '05 #1
5 2024
klh
If you just want to debug, you can use a COBOL DISPLAY in a COBOL
Stored Procedure.

The output gets written to the DB2 job used to start the stored
procedure address space.

HTH,
klh
Can anyone clarify if I can do file I/O in my circumstances? I really just want to write a few lines *somewhere* so that I can verify that the stored proc was entered and what happened when it was there.

Rhino


Nov 12 '05 #2
Hello,

your stored procedure COBOL program can do almost *anything* because DB2 is
not aware about the program statements as long as they do not refer to DB2
itself. So you can write records to any file you want, but this file must be
associated with an OS data set or JES SYSOUT by a "//filename DD..." JCL
statement contained within the DB2 stored procedure address space startup
JCL. For debugging purposes your systems administrator should already have
included a //SYSPRINT DD - Statement there which can be used as standard
COBOL output.

Regards - Walter SCHNEIDER.
"Rhino" <rh****@NOSPAM.sympatico.ca> schrieb im Newsbeitrag
news:gV******************@news20.bellglobal.com...
This question relates to DB2 Version 6 on OS/390.

Can a (COBOL) stored procedure on this platform do file I/O, i.e. write to a sequential file?

I am trying to debug a stored procedure. As far as I know, DB2 stored
procedures cannot do terminal I/O on any operating system but I know that
(Java) stored procedures in Windows/Linux/Unix can write to files and I have done this many times.

I am trying to do the same thing in OS/390 but nothing is getting written to my file. As a result, I can't tell if the client is failing to get into the stored procedure or not. Maybe it is getting into the stored proc just fine but COBOL stored procs in OS/390 can't do file I/O, unlike the case in
Windows.

Unfortunately, I haven't yet found anything in the manuals I've consulted to say one way or the other if COBOL stored procs can do file I/O in DB2 V6 on OS/390.

Can anyone clarify if I can do file I/O in my circumstances? I really just
want to write a few lines *somewhere* so that I can verify that the stored
proc was entered and what happened when it was there.

Rhino

Nov 12 '05 #3
I didn't know that 'display' statements ended up in that job! When they
didn't come out on the screen, I assumed that you couldn't do displays at
all. Stored procs in DB2 for Windows/Linux/Unix are not allowed to do screen
I/O at all so I assumed it was the same for DB2 on OS/390. I'm glad to hear
that I'm wrong; display statements are less hassle than writing to a file!

Thanks for sharing that information, it has really helped me get to the
bottom of my problem (or at least one of them).

Rhino

"klh" <kh******@yahoo.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
If you just want to debug, you can use a COBOL DISPLAY in a COBOL
Stored Procedure.

The output gets written to the DB2 job used to start the stored
procedure address space.

HTH,
klh
Can anyone clarify if I can do file I/O in my circumstances? I really

just
want to write a few lines *somewhere* so that I can verify that the

stored
proc was entered and what happened when it was there.

Rhino

Nov 12 '05 #4
I see!

That explains a lot. After I had seen klh's note about display statements
appearing in the job that starts the DB2 stored procedure address spaces, I
saw a message that I was generating about the log file; the message said the
file status after attempting to open the log file was 96. After looking up
the meaning of that status, I found that it was complaining that it didn't
have a DD statement for the log file and I was baffled because I had
provided a DD statement and I couldn't see anything wrong with it.

Your note has solved the mystery; I put the DD statement in the job that ran
the client which invoked the stored procedure but that was the wrong place:
it should have been in the job that starts the stored proc!!

I'm probably not going to be able to change the JCL for the stored proc
address space to include my log file but it doesn't matter as long as my
displays show up in the DSN1SPAS job. That means I don't need the log file
in the first place, which will make debugging a bit easier.

I'm glad I know why the log file wouldn't open though; that was really
bothering me!

Thanks!!
Walter Schneider" <wa**************@telekom.at.nospam> wrote in message
news:42***********************@newsreader02.highwa y.telekom.at...
Hello,

your stored procedure COBOL program can do almost *anything* because DB2 is not aware about the program statements as long as they do not refer to DB2
itself. So you can write records to any file you want, but this file must be associated with an OS data set or JES SYSOUT by a "//filename DD..." JCL
statement contained within the DB2 stored procedure address space startup
JCL. For debugging purposes your systems administrator should already have
included a //SYSPRINT DD - Statement there which can be used as standard
COBOL output.

Regards - Walter SCHNEIDER.
"Rhino" <rh****@NOSPAM.sympatico.ca> schrieb im Newsbeitrag
news:gV******************@news20.bellglobal.com...
This question relates to DB2 Version 6 on OS/390.

Can a (COBOL) stored procedure on this platform do file I/O, i.e. write to
a
sequential file?

I am trying to debug a stored procedure. As far as I know, DB2 stored
procedures cannot do terminal I/O on any operating system but I know
that (Java) stored procedures in Windows/Linux/Unix can write to files and I

have
done this many times.

I am trying to do the same thing in OS/390 but nothing is getting written to
my file. As a result, I can't tell if the client is failing to get into the
stored procedure or not. Maybe it is getting into the stored proc just

fine
but COBOL stored procs in OS/390 can't do file I/O, unlike the case in
Windows.

Unfortunately, I haven't yet found anything in the manuals I've

consulted to
say one way or the other if COBOL stored procs can do file I/O in DB2 V6

on
OS/390.

Can anyone clarify if I can do file I/O in my circumstances? I really

just want to write a few lines *somewhere* so that I can verify that the stored proc was entered and what happened when it was there.

Rhino


Nov 12 '05 #5
wfs
>>I'm probably not going to be able to change the JCL for the stored proc

you could always dynamically allocate the datasets...

Bill
"Rhino" <rh****@NOSPAMsympatico.ca> wrote in message
news:So********************@news20.bellglobal.com. ..
I see!

That explains a lot. After I had seen klh's note about display statements
appearing in the job that starts the DB2 stored procedure address spaces,
I
saw a message that I was generating about the log file; the message said
the
file status after attempting to open the log file was 96. After looking up
the meaning of that status, I found that it was complaining that it didn't
have a DD statement for the log file and I was baffled because I had
provided a DD statement and I couldn't see anything wrong with it.

Your note has solved the mystery; I put the DD statement in the job that
ran
the client which invoked the stored procedure but that was the wrong
place:
it should have been in the job that starts the stored proc!!

I'm probably not going to be able to change the JCL for the stored proc
address space to include my log file but it doesn't matter as long as my
displays show up in the DSN1SPAS job. That means I don't need the log file
in the first place, which will make debugging a bit easier.

I'm glad I know why the log file wouldn't open though; that was really
bothering me!

Thanks!!
Walter Schneider" <wa**************@telekom.at.nospam> wrote in message
news:42***********************@newsreader02.highwa y.telekom.at...
Hello,

your stored procedure COBOL program can do almost *anything* because DB2

is
not aware about the program statements as long as they do not refer to
DB2
itself. So you can write records to any file you want, but this file must

be
associated with an OS data set or JES SYSOUT by a "//filename DD..." JCL
statement contained within the DB2 stored procedure address space startup
JCL. For debugging purposes your systems administrator should already
have
included a //SYSPRINT DD - Statement there which can be used as standard
COBOL output.

Regards - Walter SCHNEIDER.
"Rhino" <rh****@NOSPAM.sympatico.ca> schrieb im Newsbeitrag
news:gV******************@news20.bellglobal.com...
> This question relates to DB2 Version 6 on OS/390.
>
> Can a (COBOL) stored procedure on this platform do file I/O, i.e. write to
a
> sequential file?
>
> I am trying to debug a stored procedure. As far as I know, DB2 stored
> procedures cannot do terminal I/O on any operating system but I know

that > (Java) stored procedures in Windows/Linux/Unix can write to files and I

have
> done this many times.
>
> I am trying to do the same thing in OS/390 but nothing is getting written
to
> my file. As a result, I can't tell if the client is failing to get into

the
> stored procedure or not. Maybe it is getting into the stored proc just

fine
> but COBOL stored procs in OS/390 can't do file I/O, unlike the case in
> Windows.
>
> Unfortunately, I haven't yet found anything in the manuals I've

consulted
to
> say one way or the other if COBOL stored procs can do file I/O in DB2
> V6

on
> OS/390.
>
> Can anyone clarify if I can do file I/O in my circumstances? I really

just > want to write a few lines *somewhere* so that I can verify that the stored > proc was entered and what happened when it was there.
>
> Rhino
>
>



Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: jrefactors | last post by:
I want to know the differences between SQL Server 2000 stored procedures and oracle stored procedures? Do they have different syntax? The concept...
2
by: scott | last post by:
Hi, Just wondering what sort of problems and advantages people have found using stored procedures. I have an app developed in VB6 & VB.NET and...
2
by: Kent Lewandowski | last post by:
hi all, Recently I wrote some stored procedures using java jdbc code (admittedly my first stab) and then tried to implement the same within java...
5
by: Rhino | last post by:
I am trying to determine the behaviour of stored procedures in DB2 V8.2.x in Windows/Unix/Linux and how I can control that behaviour. Some...
5
by: Tim Marshall | last post by:
I was following the thread "Re: Access Treeview - Is it Safe Yet?" with interest and on reading the post describing Lauren Quantrell's SmartTree,...
2
by: Eli | last post by:
Hi all We currently have a strange problem with calling a Stored Procedure (SQL Database) in our C# Project. The only error I get is "System...
0
by: Amber | last post by:
Stored procedures are faster and more efficient than in-line SQL statements. In this article we will look at two SQL Server stored procedures; one...
45
by: John | last post by:
Hi When developing vb.bet winform apps bound to sql server datasource, is it preferable to use SELECTs or stored procedure to read and write data...
28
by: mooreit | last post by:
The purpose for my questions is accessing these technologies from applications. I develop both applications and databases. Working with Microsoft...
11
by: peter | last post by:
I am trying to get a SQL stored procedure to use user maintained MQT implicitly which raises questions on when they are used or not used. In theory...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.