<br><font size=2 face="sans-serif">Lorry</font>
<br>
<br><font size=2 face="sans-serif">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. &nbsp;The in first request the subfile will allways be created.
&nbsp;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.</font>
<br>
<br><font size=2 face="sans-serif">Bluey</font>
<br>
<br>
<br><tt><font size=2>&nbsp;<br>
Date: Wed, 14 Feb 2007 10:08:57 -0600<br>
From: &quot;Lorry Litman&quot; &lt;LLitman@exchange.hsc.mb.ca&gt;<br>
Subject: RE: QTP to always create subfile<br>
<br>
Hi Ken,<br>
 <br>
this helps I didn't think of creating the subfile first and then output
to it.<br>
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<br>
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.<br>
 <br>
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.<br>
 <br>
this is what the code looks like (i didn't include all the temps for counting/totaling)<br>
 <br>
Thanx<br>
 &nbsp; &nbsp; &nbsp; Lorry<br>
 <br>
run Therapist_appts<br>
<br>
global temp t_ther_no num * 4 &amp;<br>
parm prompt &quot;Enter Therapist Number (4-digit max) : &quot; &amp;<br>
on errors reprompt 3 times<br>
global temp t_start_dt date century included &amp;<br>
parm prompt &quot;Enter start date for the report (YYYYMMDD) : &quot; &amp;<br>
on errors reprompt 3 times<br>
global temp t_stop_dt date century included &amp;<br>
parm prompt &quot;Enter stop &nbsp;date for the report (YYYYMMDD) : &quot;
&amp;<br>
on errors reprompt 3 times<br>
 <br>
request create_empty_subfile<br>
;access single record file to create empty subfile<br>
access PATIENT_NEXTNUM<br>
 <br>
temp tot_appt <br>
temp tot_canpc<br>
temp tot_canpcmr<br>
temp tot_pat<br>
<br>
SUB THER-20 KEEP AT FINAL &amp;<br>
INCLUDE T_THER_NO,TOT_APPT,TOT_CANPC,TOT_CANPCMR,TOT_PAT,T_STOP_DT,T_START_DT<br>
 <br>
request Retrieve_appointments<br>
 <br>
acc tbl1 in db1 link cola,colb,colc to cola,colb,colc of tbl2 in db1<br>
 <br>
sel tbl1 if col_dt ge t_start_dt and col_dt le t_stop_dt<br>
sel tbl2 if col_therapist eq t_ther_no<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>
SORT ON patientnum OF tbl1<br>
 <br>
DEF KOUNT = 1<br>
 <br>
OUTPUT *THER-20 UPDATE AT FINAL<br>
 item tot_appt sub kount<br>
 item tot_canpc sub kount &amp;<br>
 if acknowledge_cd = &quot;PC&quot; <br>
 item tot_canpcmr sub kount &amp;<br>
 if acknowledge_cd = &quot;PCMR&quot;<br>
 item tot_pat subtotal kount at psy_pat_no<br>
 <br>
build<br>
 <br>
-----Original Message-----<br>
From: Ken Langendock [mailto:Ken@Langendock.com]<br>
Sent: February 13, 2007 7:52 PM<br>
To: Lorry Litman; 'PowerHouse listserver (E-mail)'<br>
Subject: RE: QTP to always create subfile<br>
<br>
<br>
<br>
Lorry you can do this many ways.<br>
I always use this method:<br>
 <br>
RUN abc<br>
 <br>
 &nbsp;GLOBAL TEMP T-Therapist CHARACTER * 10 &amp;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; PARM PROMPT &quot;Therapist &quot;<br>
 &nbsp;GLOBAL TEMP T-StartDate DATE CENTURY INCLUDED &amp;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; PARM PROMPT &quot;Selection From (YYYYMMDD)
&quot;<br>
 &nbsp;GLOBAL TEMP T-EndDate DATE CENTURY INCLUDED &amp;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; PARM PROMPT &quot;Selection From (YYYYMMDD)
&quot;<br>
 <br>
REQUEST create-empty-subfile<br>
 <br>
ACCESS systemdefaults ; single record file<br>
 <br>
 &nbsp;TEMP T-Total<br>
 <br>
SUBFILE sfabc &amp;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;KEEP &amp;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;AT FINAL &amp;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;INCLUDE T-Therapist alias Therapist, &amp;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;T-StartDate alias
SelectionFrom, &amp;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;T-EndDate alias
SelectionThru, &amp;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;T-Total alias TotalCount<br>
 <br>
REQUEST Subtotal-my-records<br>
 <br>
ACCESS *sfabc &amp;<br>
 &nbsp;LINK Therapist OF sfabc &amp;<br>
 &nbsp; &nbsp;TO Therapist &amp;<br>
 &nbsp; &nbsp;OF mydatafile<br>
 <br>
 &nbsp;TEMP T-Counter COUNT <br>
 <br>
OUTPUT sfabc &amp;<br>
 &nbsp; &nbsp; &nbsp; UPDATE &amp;<br>
 &nbsp; &nbsp; &nbsp; AT FINAL<br>
 <br>
 &nbsp;ITEM TotalCount of sfabc FINAL T-Counter<br>
 <br>
 <br>
 <br>
-----Original Message-----<br>
From: powerh-l-bounces+ken.langendock=rogers.com@lists.sowder.com [mailto:powerh-l-bounces+ken.langendock=rogers.com@lists.sowder.com]
On Behalf Of Lorry Litman<br>
Sent: February 13, 2007 6:50 PM<br>
To: PowerHouse listserver (E-mail)<br>
Subject: QTP to always create subfile<br>
<br>
<br>
<br>
Hi, <br>
<br>
I'm using PH 7.10G and VMS 7.3-1 <br>
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.<br>
<br>
Thanx <br>
 &nbsp; &nbsp; &nbsp; Lorry <br>
<br>
<br>
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. <br>
<br>
<br>
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.<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: http://lists.sowder.com/pipermail/powerh-l/attachments/20070214/a6769b7d/attachment.htm<br>
<br>
------------------------------<br>
<br>
-- <br>
= = = = = = = = = = = = = = = = = = = = = = = = = = = =<br>
Mailing list: powerh-l@lists.sowder.com<br>
Subscribe: &amp;quot;subscribe&amp;quot; in message body to powerh-l-request@lists.sowder.com<br>
Unsubscribe: &amp;quot;unsubscribe &amp;lt;password&amp;gt;&amp;quot; in
message body to powerh-l-request@lists.sowder.com<br>
http://lists.sowder.com/mailman/listinfo/powerh-l<br>
This list is closed, thus to post to the list you must be a subscriber.<br>
Add 'site:lists.sowder.com powerh-l' to your search terms to search the
list archive at Google.<br>
<br>
End of powerh-l Digest, Vol 21, Issue 4<br>
***************************************<br>
<br>
</font></tt>
<br>