QTP to always create subfile

Robert Edis Robert_Edis at notes.ntrs.com
Wed Feb 14 10:20:28 CST 2007


Lorry

As you only want the prompt values in the SF if there is no data found the 
use the same SUBFILE ... syntax in both requests.  The in first request 
the subfile will allways be created.  In the seccond request the subfile 
created in the first request will be overwritten if data is found and left 
untouched if data is not found.

Bluey


 
Date: Wed, 14 Feb 2007 10:08:57 -0600
From: "Lorry Litman" <LLitman at exchange.hsc.mb.ca>
Subject: RE: QTP to always create subfile

Hi Ken,
 
this helps I didn't think of creating the subfile first and then output to 
it.
what I still can't get working (I rarely use qtp) is the output part since 
I don't access the subfile in the qtp program
the first error I ran into with output subfile is that it didn't know 
about the subfile, ie subfile not found, so I added the asterisk in front 
of the subfile name which then produced the error of not being able to 
find the linkage for the subfile.
 
I don't access the subfile in the qtp program. in the second request I am 
accessing a couple other database tables and then do a select, which may 
result in records found or not. I use the subfile that's created here in a 
couple other quiz programs that use the prompted parameters stored in this 
subfile and other data if it exists.
 
this is what the code looks like (i didn't include all the temps for 
counting/totaling)
 
Thanx
       Lorry
 
run Therapist_appts

global temp t_ther_no num * 4 &
parm prompt "Enter Therapist Number (4-digit max) : " &
on errors reprompt 3 times
global temp t_start_dt date century included &
parm prompt "Enter start date for the report (YYYYMMDD) : " &
on errors reprompt 3 times
global temp t_stop_dt date century included &
parm prompt "Enter stop  date for the report (YYYYMMDD) : " &
on errors reprompt 3 times
 
request create_empty_subfile
;access single record file to create empty subfile
access PATIENT_NEXTNUM
 
temp tot_appt 
temp tot_canpc
temp tot_canpcmr
temp tot_pat

SUB THER-20 KEEP AT FINAL &
INCLUDE 
T_THER_NO,TOT_APPT,TOT_CANPC,TOT_CANPCMR,TOT_PAT,T_STOP_DT,T_START_DT
 
request Retrieve_appointments
 
acc tbl1 in db1 link cola,colb,colc to cola,colb,colc of tbl2 in db1
 
sel tbl1 if col_dt ge t_start_dt and col_dt le t_stop_dt
sel tbl2 if col_therapist eq t_ther_no
 
SORT ON patientnum OF tbl1
 
DEF KOUNT = 1
 
OUTPUT *THER-20 UPDATE AT FINAL
 item tot_appt sub kount
 item tot_canpc sub kount &
 if acknowledge_cd = "PC" 
 item tot_canpcmr sub kount &
 if acknowledge_cd = "PCMR"
 item tot_pat subtotal kount at psy_pat_no
 
build
 
-----Original Message-----
From: Ken Langendock [mailto:Ken at Langendock.com]
Sent: February 13, 2007 7:52 PM
To: Lorry Litman; 'PowerHouse listserver (E-mail)'
Subject: RE: QTP to always create subfile



Lorry you can do this many ways.
I always use this method:
 
RUN abc
 
  GLOBAL TEMP T-Therapist CHARACTER * 10 &
         PARM PROMPT "Therapist "
  GLOBAL TEMP T-StartDate DATE CENTURY INCLUDED &
         PARM PROMPT "Selection From (YYYYMMDD) "
  GLOBAL TEMP T-EndDate DATE CENTURY INCLUDED &

         PARM PROMPT "Selection From (YYYYMMDD) "
 
REQUEST create-empty-subfile
 
ACCESS systemdefaults ; single record file
 
  TEMP T-Total
 
SUBFILE sfabc &
        KEEP &
        AT FINAL &
        INCLUDE T-Therapist alias Therapist, &
                T-StartDate alias SelectionFrom, &
                T-EndDate alias SelectionThru, &
                T-Total alias TotalCount
 
REQUEST Subtotal-my-records
 
ACCESS *sfabc &
  LINK Therapist OF sfabc &
    TO Therapist &
    OF mydatafile
 
  TEMP T-Counter COUNT 
 
OUTPUT sfabc &
       UPDATE &
       AT FINAL
 
  ITEM TotalCount of sfabc FINAL T-Counter
 
 
 
-----Original Message-----
From: powerh-l-bounces+ken.langendock=rogers.com at lists.sowder.com 
[mailto:powerh-l-bounces+ken.langendock=rogers.com at lists.sowder.com] On 
Behalf Of Lorry Litman
Sent: February 13, 2007 6:50 PM
To: PowerHouse listserver (E-mail)
Subject: QTP to always create subfile



Hi, 

I'm using PH 7.10G and VMS 7.3-1 
I have a small qtp program that prompts for a therapist number, start and 
end dates. It then does some counting of items and writes to a subfile. 
The problem I'm having is the subfile is only created if records are 
found, however, I need the subfile to always be created and include the 
items prompted for because this file is then accessed by a quiz program 
that does some reporting.

Thanx 
       Lorry 


This e-mail and/or any documents in this transmission is intended for the 
address(s) only and may contain legally privileged or confidential 
information. Any unauthorized use, disclosure, distribution, copying or 
dissemination is strictly prohibited. If you receive this transmission in 
error, please notify the sender immediately and return the original. 


This e-mail and/or any documents in this transmission is intended for the 
address(s) only and may contain legally privileged or confidential 
information. Any unauthorized use, disclosure, distribution, copying or 
dissemination is strictly prohibited. If you receive this transmission in 
error, please notify the sender immediately and return the original.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://lists.sowder.com/pipermail/powerh-l/attachments/20070214/a6769b7d/attachment.htm


------------------------------

-- 
= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l at lists.sowder.com
Subscribe: &quot;subscribe&quot; in message body to 
powerh-l-request at lists.sowder.com
Unsubscribe: &quot;unsubscribe &lt;password&gt;&quot; in message body to 
powerh-l-request at lists.sowder.com
http://lists.sowder.com/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.
Add 'site:lists.sowder.com powerh-l' to your search terms to search the 
list archive at Google.

End of powerh-l Digest, Vol 21, Issue 4
***************************************


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sowder.com/pipermail/powerh-l/attachments/20070214/ca11bd7c/attachment.html


More information about the powerh-l mailing list