Locking Sequential Files in QTP

Murray Scholz murray.scholz@abri.une.edu.au
Wed, 14 Jul 1999 16:56:55 +1000


Terry,

I'm using 710G1 on Alpha/VMS, and the following works if you include a
couple
of SET FILE OPEN n SHARE statements in the qtp run (fairly obscure
??!!!).
I believe you need both the SHARE option AND the different open numbers.

Something along the lines of the following seems to work for me.

$ QTP
run aaa
set proc nolim
;-----------------
request r1
access <any old file>
output daily-trans add		(this is a sequential file in the dictionary)
item date-stamp final sysdate
item vms-username final logonid
set file daily-trans open 0 share
;----------------------
;  Now read the sequential file in for the next request
;
request r2
access daily-trans
set file daily-trans open 1 share
select if date-stamp = sysdate
subfile abc keep include daily-trans
;------------------------
go

Hope this helps you out.

Cheers

Murray Scholz
Agricultural Business Research Institute
University of New England
Armidale NSW 2351 Australia


Terry Pickering wrote:
> 
> I have a sample QTP run that demonstrates you can not access a SEQUENTIAL
> file in more than one request within a QTP run.
> 
> In the example below, the file GLS-INTERFACE is a sequential file that has
> just been built and is empty. The first request reads a file and outputs
> records to the sequential file. The second request then reads the
> sequential file and creates a subfile.
> 
> I've tried everything including alias names on the all of the files. Added
> SET FILE and SET LOCK statements. Nothing prevents this from happening:
> 
> ~~~~~~~~~~~~~~~~~~~~~~ P A S T E ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Q T P   (7.10.F4)
> Copyright 1996 COGNOS INC. (ALPHA)
> 
> > USE TP025
> >
> > ;*******************************************************************
> > REQUEST CREATE-RECORDS
> > ;*******************************************************************
> > ACCESS WPS-ACCT-DISTRIB
> > OUTPUT GLS-INTERFACE ADD
> >
> > ;*******************************************************************
> > REQUEST CREATE-SUBFILE
> > ;*******************************************************************
> > ACCESS GLS-INTERFACE
> >
> > SUBFILE INTERFACE-OFFSET KEEP INCLUDE GLS-INTERFACE
> > GO
> ----------------------------------------------------------------------------
> ---
> Data access error. (GLS-INTERFACE)
> 
>    File:  GLS_DAT:GLS014
> 
> Action Taken: Run terminated.
> ----------------------------------------------------------------------------
> ---
> %RMS-E-FLK, file currently locked by another user
>    File:  GLS_DAT:GLS014
> ----------------------------------------------------------------------------
> ---
> %SYSTEM-W-ACCONFLICT, file access conflict
>    File:  GLS_DAT:GLS014
> ----------------------------------------------------------------------------
> ---
> Changes made since the last commit have been rolled back to a stable state.
> Therefore, statistics reported may be incorrect.
> ----------------------------------------------------------------------------
> ---
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Terry Pickering        Consultant Extraordinare
> Monday and Friday        Tuesday - Thursday
> Portland                 Eugene
> (503) 245-7178           (541) 687-3416
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.