If you develop SQR programs and test them with SQRW, you may wonder
why you can't see your report without copying the LIS file to the
printer. Or you may know about the SQR report viewer but can't get
it to run because it always reports an error. With a little luck,
we'll be able to fix that today.
The SQR report viewer (SQRWV) is a program that displays the report
that your SQR program created using PRINT statements. (It is not
the log that contains
the output of SHOW and DISPLAY statements.) The viewer should run
automatically after your program finishes if you include the -ZIV
command-line flag when running SQRW. The viewer reads and displays
the SPF file, which is SQR's internal format for reports.
Including the -ZIV flag is all that should be necessary to run the
viewer. But at many installations, this doesn't work and users always
see the error message "The required environment variable SQRDIR
has not been defined". Defining the environment variable through
Control Panel or using a SET doesn't help.
What the viewer really wants is a file called SQR.INI in the main
Windows folder (C:\WINDOWS or C:\WINNT, depending on your version
of Windows). This file must include an SQRDIR= line, and it must
be called SQR.INI (not PSSQR.INI). An easy way to create it is to
copy your PSSQR.INI file to the Windows folder and rename it.
Then run your SQR under SQRW with the -ZIV option and your report should
The latest version of the SQR debugger
includes an option to run the viewer, and it will create the SQR.INI
file in the correct location if necessary.