Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Subfile usage in a batch program

100 views
Skip to first unread message

Gordon Dracup

unread,
Oct 15, 1996, 3:00:00 AM10/15/96
to

Does anybody know of way to use subfile as work areas in a batch program
? I can get it working from a batch job if the display file is
overridden to a varied on device, but I don't really want to have to
leave a device varied on just for this job.

The idea is to use the same program for interactive and batch processing
and the subfile would contain the work data and display data as well.

Any thoughts would be much appreciated.

Cheers

Gordon
--
Gordon Dracup

Njal Fisketjon (Njål Fisketjøn)

unread,
Oct 16, 1996, 3:00:00 AM10/16/96
to

Gordon Dracup <gor...@tsprout.demon.co.uk> wrote:

Since file I/O is slow (even subfiles); I would have considered using
arrays or user indexes (or even user spaces) as work areas. You could
still have the same program do both.


Njål Fisketjøn
FIGU DATA AS
nfis...@figu.no
nfis...@e-mail.com


Gordon Dracup

unread,
Oct 16, 1996, 3:00:00 AM10/16/96
to

Njal_Fisketjon writes
I was hoping to avoid placing a limit on the amount of data (e.g and
arrary of 2000 or a multiple occurecnce data structure of 2000). The
subfile would not have this problem.

I only really want to avoid duplicate coding for what is essentially the
same function performed in a batch and interactive job.

Many thanks

Gordon
--
Gordon Dracup

Gary Guthrie

unread,
Oct 16, 1996, 3:00:00 AM10/16/96
to Gordon Dracup

Gordon,

With respect to subfiles in batch jobs...

You're going to have to have a workstation allocated to the batch job in
order to use subfiles, I do believe.

I would suggest you use a user index instead. Far better performance, I
do believe, again!

Good luck.

Gary Guthrie

D.P. Req.

unread,
Oct 17, 1996, 3:00:00 AM10/17/96
to

>Does anybody know of way to use subfile as work areas in a batch program
>? I can get it working from a batch job if the display file is
>overridden to a varied on device, but I don't really want to have to
>leave a device varied on just for this job.
>
>The idea is to use the same program for interactive and batch processing
>and the subfile would contain the work data and display data as well.

As far as I know, you are already doing all that you can. I was faced with
the same situation and ended up rewriting my programs to use files that I
placed in QTEMP in place of the subfiles. Of course, this required writing
a routine that would read the records from the file and place them on the
screen appropriately for handling rollup and rolldown situations.

The only other way around might be by using the Virtual Terminal APIs, but
I have not yet taken the time to play with them to see exactly how they
work, or if they would do what you are asking.

--

Bryan Hipp
D.P. Requisite, Inc.
Tulsa, OK

The views expressed above ARE those of my employer. According to my
employment contract, any ideas I have are the property of my employer.


David Leland

unread,
Oct 17, 1996, 3:00:00 AM10/17/96
to

Although, a subfile does have a limit of 9999 records.

Dave

Njal Fisketjon (Njål Fisketjøn)

unread,
Oct 17, 1996, 3:00:00 AM10/17/96
to

Gordon Dracup <gor...@tsprout.demon.co.uk> wrote:

>I was hoping to avoid placing a limit on the amount of data (e.g and
>arrary of 2000 or a multiple occurecnce data structure of 2000). The
>subfile would not have this problem.

>I only really want to avoid duplicate coding for what is essentially the
>same function performed in a batch and interactive job.

Subfiles place a limit of 9999 records (the same as arrays). User
indexes does not have this limitation. (User indexes are an object of
a similar type as the one's used internally for output queues, job
queues, logical files, a.s.o.). The user index API's runs fast
compared to subfiles. It's fairly easy to read one page at the time
from an user index.

Bradley V Stone

unread,
Oct 18, 1996, 3:00:00 AM10/18/96
to

Not in Version 3.1 and up. I can't remember the limit. There are some new
functions built in that allow the use of dynamic allocation. It is in the
manual somewhere.

David Leland <dle...@net-link.net> wrote in article
<01bbbbc4$47c38280$2af1...@dleland.net-link.net>...


> Although, a subfile does have a limit of 9999 records.
>
> Dave
>

> > I was hoping to avoid placing a limit on the amount of data (e.g and
> > arrary of 2000 or a multiple occurecnce data structure of 2000). The
> > subfile would not have this problem.
> >
> > I only really want to avoid duplicate coding for what is essentially
the
> > same function performed in a batch and interactive job.
> >

Jayne A Little

unread,
Oct 18, 1996, 3:00:00 AM10/18/96
to

We have recently stepped to a new standard of maintenance/inquiry program
which looks a bit like PDM when using a workstation.

Our workstation file is "user controlled open". The workstation file can
be opened when in interactive mode. It is not always opened when called
interactively, as we also use the program when we want to add a record
using data derived from an interactive calling program when we don't want
to show the user an add screen in the called program.
The way we pass data to it is through the use of a batch & a control file
which are duplicates of the file being maintained, one is used for data
passing and the other for "update" controls. We put a different prefix in
front of the two different files, ie B_ (batch) & C_(control). We have
used duplicate files as they are easily created (crtdupobj in QTEMP).

Picture a file with three fields, part & description and activity code.
The first file would have a value in the part & description fields.
The 2nd file would have a value '1' for update in the part & description
fields and a '2' in the activity field. The '2' indicates that the "field
initialization" routine should use the default value, rather than the value
contained in the file. This was important due to some fields being needed
to be updated to zero or blank rather than the "field initialization"
value.

The advantage of this is that all edits are in the same program for batch
or interactive use. Greatly reduces maintenance times.
We use similair naming conventions & move the fields using datastructures,
safer coding.
We did not go the subfile use, as the sub-file only contains in our case,
the main pieces of information about the record, and it is often the
details which need to be updated.

It's well worth the effort to get one that does both. We are amazed at how
much flexibility we have been able to build in. Yes, the code is long, but
it is all in one place. At some point, we hope to be able to split it into
modules, (hide the techie code), but due to expected life expectancy of our
code, it cannot be cost justified at this time.

That's all,
Jayne A Little
jli...@wat.hookup.net
Cambridge, Ontario, Canada

Njal Fisketjon (Njål Fisketjøn) <nfis...@figu.no> wrote in article
<543092$n...@troll.powertech.no>...


> Gordon Dracup <gor...@tsprout.demon.co.uk> wrote:
>
> >Does anybody know of way to use subfile as work areas in a batch program
> >? I can get it working from a batch job if the display file is
> >overridden to a varied on device, but I don't really want to have to
> >leave a device varied on just for this job.
>
> >The idea is to use the same program for interactive and batch processing
> >and the subfile would contain the work data and display data as well.
>

> >Any thoughts would be much appreciated.
>
> Since file I/O is slow (even subfiles); I would have considered using
> arrays or user indexes (or even user spaces) as work areas. You could
> still have the same program do both.
>
>

0 new messages