Sequential Period generator?
Latimer, Richard
richard.latimer@airways.co.nz
Wed, 2 Aug 2000 12:02:27 +1200
Martyn,
Do you know in advance how many records you need to create?
We do something similar where we prompt for a date window and generate up to
a maximum of 12 (weekly) records:
1st Request:
access eqdet
define date-window date = parm prompt "Date Window "
subfile tm018sb1 include equipno,keyword,date-window
2nd request:
access *tm018sb1
temporary per1 date
temporary per2 date
temporary per3 date ; etc etc
item per1 = monday ;(this is a date corresponding to the first
Monday in the period)
item per2 = date(days(per1) + 7)
item per3 = date(days(per1) + 14) ; etc etc
subfile tm018sb4 include tm018sb3, &
per1,week-start-char1
subfile tm018sb4 alias tm018sb4a append include tm018sb3, &
per2,week-start-char2
subfile tm018sb4 alias tm018sb4b append include tm018sb3, &
per3,week-start-char3
This process uses subfiles (and another couple of passes to do some other
things) , in your case I think conditional OUTPUTS straight into you target
file would work better.
Something like:
output file a alias a1 if per? < dte_window
item "whatever"
good luck!
Richard
> -----Original Message-----
> From: Thomson, Martyn EDUC:EX [SMTP:martyn.thomson@gems1.gov.bc.ca]
> Sent: Wednesday, August 02, 2000 8:56 AM
> To: 'POWERHOUSE Listserv'
> Subject: Sequential Period generator?
>
> Hello all
> Can anybody suggest a simple QTP strategy to accomplish the following -
>
> I have a table UWI_RANGE which contains an Id field, and start and end
> periods in the format YYYYMM -char(6).
>
> I need to populate another table UWI_PERIODS which contains the same ID
> field and a PERIOD char(6) - creating one record for each month in the
> range
> for the ID. Currently this is done by a 'while retrieving' loop in a
> batch
> Quick screen, but I would like to rewrite it in QTP.
>
> There is another table DB_PERIODS available which contains a field
> DB_PERIOD
> char(6) and has a row for every period ever used. Perhaps this can be
> linked
> to in some way and a SELECT statement used to limit the transaction set to
> the period range?
> Any help with this much appreciated.
> Martyn
>
>
> = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> =
> Subscribe: "subscribe powerh-l" in message body to
> majordomo@lists.swau.edu
> Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
> This list is closed, thus to post to the list, you must be a subscriber.
**********************************************************************
This electronic message together with any attachments is confidential. If you receive it in error: (i) you must not use, disclose, copy or retain it; (ii) please contact the sender immediately by reply email and then delete the emails. Views expressed in this email may not be those of the Airways Corporation of New Zealand Limited
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.