HP3000-L Archives

October 1996, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Robert Rose <[log in to unmask]>
Reply To:
Robert Rose <[log in to unmask]>
Date:
Sat, 12 Oct 1996 15:49:56 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (124 lines)
  I've seen a thread here about using FCOPY to print to multiple output
devices.  We are doing that at my site, but without FCOPY.  We use STREAMX
and QUIZ for our batch reporting.  The QUIZ reports always go to a disk file
with carriage control enabled (SET FORMFEED).  The job contains STREAMX code
that repeatedly asks the submitter to select an output device from a file
of printers.  For each one, a file equation is created, like
:FILE outputfile;REC=-recsize;CCTL, then a print command is issued, like
:PRINT discfile,*outputfile.  The STREAMX code loops until no more printers
are selected, at which point the disc file is deleted.  This works really nice,
since the Quiz report runs only once, and we've encapsulated all of it in a
STREAMX ::USE file.  The batch job needs to set some STREAMX variables, such
as the name of the Quiz program to run, the default printer for the location
the user is at, the number of parms to the QUiz report, and a series of
variables that represent the parms to be passed to Quiz.  Also, the output
file record length (in bytes, i.e. -132 or -220) is also captured.  The
STREAMX routine creates the JCL to run the Quiz program, feed it all it's
prompt responses, and print the resulting disk file to as many printers as
necessary.  Below is some code I've clipped out of a job stream to illustrate:

!#######################################################################
!# 13. Run the Quiz reports.                                           #
!#######################################################################
::USE CHOOSFCT.JCU.FM9
::IF PRM_FCTRY = "" THEN
::  ECHO
::  ECHO No factories to report, job will not be streamed.
::  EXIT
::ENDIF
::######################################################################
::#  The while loop runs until there is no factory selection.          #
::######################################################################
::WHILE PRM_FCTRY <> "" DO
::  ####################################################################
::  #  This block runs SQZMF084.                                       #
::  ####################################################################
::  ASSIGN REPORT_NAME = "SQZMF084"
::  ASSIGN REPORT_WIDTH = -132
::  ASSIGN QUIZ_PROG = "SQZMF084.QUIZSOR"
::  ASSIGN SXNUMPARMS = 1
::  ASSIGN SXPARM1 = PRM_FCTRY
::  USE GPPRINT.JCU.FM9
::  ####################################################################
::  #  Ask for the next factory.                                       #
::  ####################################################################
::  USE CHOOSFCT.JCU.FM9
::ENDWHILE

Chosfct is a streamx routine that asks for a factory to report.  That is
used to create a default printer from a number of CI variables that are
set in the account logon UDC,  It also sets a parm that is passed to Quiz.

Below is the GPPRINT routine.

::######################################################################
::# GPPRINT.JCU                                                        #
::#                                                                    #
::# STREAMX use file to prompt for a print destination and number of   #
::#         copies, run a quiz report, passing in all required parms,  #
::#         print the report to the selected destination, then ask for #
::#         more print destinations and numbers of copies until the    #
::#         user indicates no more copies are to be printed.           #
::#                                                                    #
::# Required variables:                                                #
::#                                                                    #
::#   REPORT_NAME  (name of the spool file designator and disc file)   #
::#   REPORT_WIDTH (report record width as it should be specified in a #
::#                 file equation: bytes are negative, works positive) #
::#   PLANT_NAME   (needs to be set to a plant with a default printer  #
::#                 variable set in the logon UDC)                     #
::#   QUIZ_PROG    (fully qualified name of the Quiz program to run)   #
::#   SXNUMPARMS   (number of parameters to be passed to Quiz)         #
::#   SXPARMn      (one of these, consecutively numbered starting at   #
::#                 1, is needed for as many parameters as are         #
::#                 specified in SXNUMPARMS)                           #
::#                                                                    #
::# Modification history:                                              #
::#                                                                    #
::#  05/04/96 BR  Created.                                             #
::######################################################################
::RUN GPPRINT.DMPROG.FM9;LIB=G;INFO=&
::    "REPORT={REPORT_NAME} PLANT={PLANT_NAME} &
::     DEF=!_{PLANT_NAME}_DEF_PRINTER"
::IF BOUND(SXPRINTER) AND BOUND(SXCOPIES) THEN
!   FILE {REPORT_NAME}={REPORT_NAME}.MASPUB
!   CONTINUE
!   PURGE *{REPORT_NAME}
!   QUIZ 'AUTO={QUIZ_PROG} NOLIST'
::  ASSIGN SXINDEX = 1
::  WHILE SXINDEX <= SXNUMPARMS
{SXPARM{SXINDEX}}
::    ASSIGN SXINDEX = SXINDEX + 1
::  ENDWHILE
    EXIT
::  WHILE BOUND(SXPRINTER) AND BOUND(SXCOPIES) DO
!     FILE {REPORT_NAME};&
!       CCTL;&
!       DEV={SXPRINTER},,{SXCOPIES};&
!       REC={REPORT_WIDTH}
!     PRINT {REPORT_NAME}.MASPUB,*{REPORT_NAME}
::    PROMPT STRING PRINT_AGAIN= "Print another copy (Y/N) [N]: ";&
::      DEFAULT="N";&
::      CHECK=(UPS(LTRIM(RTRIM(PRINT_AGAIN)))="Y" OR &
::             UPS(LTRIM(RTRIM(PRINT_AGAIN)))="N");&
::      CHECKERROR="Please enter 'Y' or 'N'."
::    ASSIGN PRINT_AGAIN=UPS(LTRIM(RTRIM(PRINT_AGAIN)))
::    IF PRINT_AGAIN="N" THEN
::      DELETEVAR SXPRINTER,SXCOPIES
::    ELSE
::      RUN GPPRINT.DMPROG.FM9;LIB=G;INFO=&
::        "REPORT={REPORT_NAME} PLANT={PLANT_NAME} &
::        DEF=!_{PLANT_NAME}_DEF_PRINTER"
::    ENDIF
::  ENDWHILE
!   PURGE {REPORT_NAME}.MASPUB
::ENDIF

It's a little complex, but allows us to add multiple-factory, multiple
printer capability to our job streams and batch reports with very little
added to the job stream.

Hope this is useful to somebody.

Bob Rose

ATOM RSS1 RSS2