Problem: using a quiz use file multiple times
georgia miller
georgia_miller@gfps.k12.mt.us
17 Feb 1998 11:26:28 -0700
Alice,
I am on an HP3000, with PH 7.29.C3
With Quiz I would suggest setting up a USE file for each date that may need
converting. Then USEing that file when you need to format that date. Each
USE file would have different DEFINE names.
This may not be what you want:
For looping or using code multiple times, I would suggest using Quick instead
of QTP or Quiz. Quick can be run in batch mode.
The job control looks like this
!FILE QKGO=QKGOFILE
!FILE STDIN=DATEPARM
!FILE QKIN=DATEPARM
!QUICK
!REST STDIN
QKGOFILE is a QKGO file that lists the first screen as the quick screen
object you are going to run. (DATESCRN)
DATEPARM contains a parameter you want to pass to the quick screen
DATEFILE is the file that contains the dates you want to convert.
The quick screen DATESCRN will look like this:
SCREEN DATESCRN
TEMP T-PARM CHAR*10
TEMP T-DATE DATE CENTURY EXCLUDED
TEMP T-CONVERTED-DATE DATE CENTURY INCLUDED
FILE DATEFILE DESIGNER
FIELD T-PARM
PROCEDURE INTERNAL DATE-CONVERT
;Put date conversion code here
BEGIN
LET T-CONVERTED-DATE = ADDCENTURY(T-DATE)
END
PROCEDURE INITIALIZE
BEGIN
ACCEPT T-PARM
WHILE RETRIEVING DATEFILE SEQUENTIAL
BEGIN
IF DATE1 <needs converting>
;<needs converting> is test code to tell if the date needs converting?
THEN BEGIN
LET T-DATE = DATE1 OF DATEFILE
DO INTERNAL DATE-CONVERT
LET DATE1 OF DATEFILE = T-CONVERTED-DATE
END
IF DATE2 <needs converting>
THEN BEGIN
LET T-DATE = DATE2 OF DATEFILE
DO INTERNAL DATE-CONVERT
LET DATE2 OF DATEFILE = T-CONVERTED-DATE
END
<add IF BEGIN END> for each date that may need converting
PUT DATEFILE RESET
END
END
BUILD
This may not do exactly what you want, but it's an example of running a quick
screen in batch mode. You can also do looping in Quick with the FOR x
command. You may or may not need to pass a parameter to the screen.
DATEFILE must be defined in the Dictionary. You can do a lot with Quick
running it in batch mode to process or build a file that you can't do with
Quiz or Qtp.
Another way we do loops is using MPEX WHILE command. MPEX is a utiity sold by
VESOFT. It could for example run quiz several times until a JCW is set a
certain way.
--------------------------------
Georgia Miller, Systems Analyst
Email: georgia_miller@gfps.k12.mt.us
Great Falls Public Schools
1100 4th Street South
Great Falls, MT 59405
(406)791-2358
______________________________________________________________________________
_
From: Alice DeWit on Mon, Feb 16, 1998 11:03 PM
Subject: Problem: using a quiz use file multiple times
Hi, I wonder if anyone can help solve a problem I have....
OBJECTIVE: to call a subprogram or utility ( that does a date conversion)
multiple times from within one pass from QUIZ and QTP. The
subprogram/utility should be able to be called from many programs.
DETAILS: I want to be able to call a common utility/program many times
from a Quiz or Qtp program. I have to do a date mapping conversion for a
encoded date each time I display or use a date. This means that in one
pass I may have to convert 2 to 10 dates.
PROBLEM: If a use a Quiz subprogram as a utility , the second time I use
the quiz subprogram to convert a date, I get duplicate define problems,
unless I convert a date per pass, which is unwieldy.
If I execute a DCL command file after I set a symbol using
SETSYSTEMVAL in quiz, I have to execute the quiz program before the
symbol is set. This means that I would only be able to convert one date
per pass which is unmanageable
ENVIRONMENT: I am working on DEC VAXES and ALPHAS using
Powerhouse 7.10.e1 and 7.10.e6
Does anyone have a solution? If you have please let me know. Thanks in
advance.