473,503 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2119
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
10708
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 should be the same that the stored procedures...
2
2792
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 our developers are starting to re-write some of the...
2
9196
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 packages (for code reuse). I encountered...
5
3378
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 documentation in the manuals is confusing the issue...
5
3457
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, I've run into something I don't understand: Stored...
2
3314
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 error" which says a lot :) Background: We have...
0
2630
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 using an input parameter and one not, and see how...
45
3361
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 from/to SQL Server? Why? Thanks Regards
28
72329
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 C#.NET and Microsoft SQL Server 2000 Production and...
11
3392
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 you would expect the stored procedure to pick up...
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7453
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5576
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4670
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3162
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
732
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.