[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference ilbbak::ibi_focus

Title:FOCUS, from INFORMATION BUILDERS
Moderator:ZAYIUS::BROUILLETTE
Created:Thu Feb 19 1987
Last Modified:Mon May 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:615
Total number of notes:1779

303.0. "Callable DCL output spooler from FOCUS" by FDCV01::LEVASSEUR (Barking Pumpkin Software Inc) Fri Jan 12 1990 12:17

      IN our group I have set up ~35 separate fex's that generate as wide
    variety of reports asking users to supply variables for that fex. it
    is important that each fex's offline output have a separate file name,
    which identifies the report. 
      In the past, I had a generic [to our system] local LPS40 que hard
    coded into the fex. If the queue was busy/down, I had to manually
    send the report elsewhere for the user, since in our application I
    have everything running under DCL and FOCUS menus.
      The first version of the .com file shown in .2 would display a
    current listing of report files and ask the user to select theirs from
    the files shown; this casued confusion at times, but did work. I solved
    the problem by assigning a logical name in each fex equal to the report
    name and then call the print spooler FOCPRINT.COM. This seems to work
    fairly well, since there are never more than 2-3 user in our account at
    one time. 
      It allows, instead of defaulting to a hard coded print queue; the
    option to print on a variety of queues [specific to us here], to a
    local LA50/Lno3 or VAXmail. 
      I purposely have all 8 character report file names coded with an N
    or W in the 8th character, This tells the com file to either print
    wide or normal, so the user doesn't have to figure out if it's an
    80/132 column report.
      If anyone finds this useful, let me know. I'm sure there are other
    ways of solving the problem I had but this one works for me.
    
    reply .1 is part of sample fex, .2 is the DCL com file called for
    print spooling options
    
    Ray 
T.RTitleUserPersonal
Name
DateLines
303.1a sample portion of fexFDCV01::LEVASSEURBarking Pumpkin Software IncFri Jan 12 1990 12:2073
-*
-*********************************************************************
-*
-* Program: QTR4.FEX
-* Authror: Ray Levasseur, DSS Hacker support
-* Date written: March 1988
-*
-* This fex generates a 4 quarter report at any geo or segment level
-* and uses the <mumble> data file, which is an expanded version of
-* the <grumble> file. File is created by <bumble>.COM job stream.
-*
-* Ray Levasseur November 1989
-*
-* Added enhancements which will trap input errors during selection by user
-* of variables that are passed to program at run time. Also made variable
-* input a bit friendlier, no need to separate values with or's.
-*
-*********************************************************************
-*
VMS DELETE LZ4QTRGN.LIS;*
FILEDEF OFFLINE DISK LZ4QTRGN.LIS
OFFLINE
     .
     .
     .
 Define file, variables, user validation, crtforms, all sorts
 of things to upset, amaze, confuse and give the user all sorts
 of report possibilities; all 30 or so fex's are like this. All
 reports form all fex's have report name filedef'd with group,
 report and print width identifiers.

 in other fex's

 LZ10ARGW.LIS
 LZ8330TN.LIS
 
 Etc, etc, etc
      .
      .
      .
TABLE FILE MUMBLE
      .
      .
Sorts computes, blah blah, etc
      .
      .
-TYPE
-TYPE        
-TYPE Please wait while I generate a 4 Quarter Report. This may take a minute
-TYPE or so. Report name will be = LZ4QTRGN.LIS
-TYPE
-TYPE  ***** PLEASE DO NOT HIT ANY KEYS UNTIL I COMPLETE REPORT *****
-TYPE              AND BRING YOU TO PRINT OPTIONS MENU
-TYPE
-TYPE
-RUN
-TYPE
-TYPE MAKE ALL DONE!!          Changes with the fex or the weather
-TYPE                          vvvvvvv
-VMS DEFINE/JOB/NOLOG FOCRPT LZ4QTRGN.LIS
-VMS @FOCPRINT
-*
-*
-* The OOPS! I goofed abort label. I would say, come on back later I
-* got a headache, but , the less said the better
-*
-NOTNOW
-TYPE COME ON BACK AGAIN
-END
END
    
    
    Ray
303.2The print spooler .comFDCV01::LEVASSEURBarking Pumpkin Software IncFri Jan 12 1990 12:20332
$!
$!
$!=======================================================================
$! Program: FOCPRINT.COM
$! Author: Ray Levasseur,  DSS Hacker support
$! Location: PKO3-2/26J  DTN: 223-4303
$! Dept: U.S. Fiscal Reporting
$! Date Completed/Tested: January 8, 1990
$!
$!=======================================================================
$!
$! This com file will be called from FOCUS after a report is run and
$! offer the user a number of output options. In the past output from
$! report requests was hard coded to go to a generic print queue. In
$! many cases a report is to be sent to someone outside the Fiscal
$! Reporting group and the average user would not know how to access
$! the files or what the file name is; the same holds true when a generic
$! LPS40 queue is busy or down and a user needs report in a hurry.
$! 
$! Within the body of each FOCUS report fex, after teh report completes
$! a logical is defined from within focus as:
$!
$! -VMS DEFINE/JOB/NOLOG FOCRPT FILE.EXT
$!
$! This defines a VMS logical equal to the file named defined for each
$! FOCUS report. Each time a report is run, the logical is superceded,
$! which is why the /NOLOG qualifier is placed in command line. The user
$! does not need to see or be distracted by a message that FOCRPT has
$! been superceded.
$!
$! After the report runs and this file is called from the fex, the user 
$! will be shown an output options menu . A symbol will be assigned to the
$! translated value of the logical, equal to the file name. Each file name is
$! coded with print width information so that the user will not accidentally 
$! print a 132 character report at 80 and get garbage. 
$!
$! The logicals LPSL, TLL, LCL, etc are defined at login by COMMAND.COM
$!
$! Caveat:
$!
$! This has not happened yet! <!!!!!!>, but if two users are running different
$! reports and both complete at the same time there could be a conflict over 
$! which file gets assigned to the logical first. Right now I'm too buried to
$! read over all those 25 pound manuals, and let's hope, 'so far so good', that
$! everything keeps running A-OK!.
$!
$!-----------------------------------------------------------------------------
$!
$! So now we'll set up defaults, messages and all kinds of stuff the user
$! doesn't have to know about.
$!
$ Default_Stuff:
$!
$! Keep those who don't have a need to know, out of places that they may
$! get lost in. These people who think ctrl c/y is a cure for everything!!!!
$!
$ Set NOON
$ On CONTROL_C then goto ENDALL
$ On CONTROL_Y then goto ENDALL
$!
$ ESC[0,8] = 27
$ FF[0,8]  = 12
$ CLR      = "''ESC'[0;0H''ESC'[2J"
$ BLD      = "''ESC'[1m"
$ NOR      = "''ESC'[0m"
$ W        = "WRITE SYS$OUTPUT"
$ Title1   = "      ''BLD' U.S. Fiscal Reporting ''NOR'"
$ Title2   = "      ''BLD'   FOCUS P&L Reports ''NOR'" 
$ Title3   = "      ''BLD'Output Options Main Menu ''NOR'"
$!
$!
$ P1 = F$TRNLNM("FOCRPT")
$! 
$! We'll use PW to decide which way to print, based on last character
$! extracted from report name. This way the user diesn't have to worry
$! about specifying 80 characters where 132 are required and vice versa.
$!
$ PW = F$EXTRACT(7,1,''P1')
$ If "''PW'" .eqs. "N" then PM = "''BLD'80 Column Report - Portrait''NOR'"
$ If "''PW'" .eqs. "W" then PM = "''BLD'132 Column Report - Landscape''NOR'"
$!
$! Let the games begin!!!
$!
$ W "''CLR'"
$ W "    ''Title1'"
$ W "    ''Title2'"
$ W ""
$ W " Report for printing: ''BLD' ''P1' ''NOR'"
$ Inquire reply -
    "''BLD' Hit any key to continue ''NOR'"
$!
$ Goto OUTPUT_MENU
$!
$! OUT_ERR:
$! Ermsg = ""
$ OUTPUT_MENU:
$!
$ W "''CLR'"
$ W "''Title1'"
$ W "''Title2'"
$ W "''Title3'"
$ W ""
$ W "  LJ. Print at Pole 26J LPS40"
$ W "  LD. Print at Pole 29D LPS40"
$ W "  LH. Print at Pole 23H LPS40"
$ W ""
$ W "  LA. Print Locally on an LA50"
$ W "  LN. Print Locally on an LN03"
$ W "  VM. VAXmail Report"
$ W "  EX. Exit back to FOCUS"
$ W ""
$!
$ Inquire out -
     "''BLD'Enter Print Option or EX to exit back to FOCUS''NOR'" 
$ PO = F$EXTRACT(0,2,out)
$ If "''PO'" .eqs. "LJ" then goto POLE26J
$ If "''PO'" .eqs. "LD" then goto POLE29D
$ If "''PO'" .eqs. "LH" then goto POLE23H
$ If "''PO'" .eqs. "LA" then goto LA50
$ If "''PO'" .eqs. "LN" then goto LN03
$ If "''PO'" .eqs. "VM" then goto VAXMAIL
$ If "''PO'" .eqs. "DI" then goto SELECT_RPT
$ If "''PO'" .eqs. "EX" then goto ENDALL
$ If "''PO'" .eqs. "" then goto OUTPUT_MENU
$ W ""
$ W "Invalid selection, ''BLD' ''PO' ''NOR' please re-enter"
$ Wait 00:00:02                   ! Let them see where they've sinned
$ Goto OUTPUT_MENU
$!
$!
$!
$ POLE26J:
$!
$ W "''CLR'"
$ W " "
$ W " Selected Report> ''BLD' ''P1' ''NOR'"
$ W ""
$ W " Is now being queued at the Pole 26J LPS40"
$ W ""
$ W " ''PM'"
$ W ""
$ If "''PW'" .eqs. "W" then goto LAND26J
$ If "''PW'" .eqs. "N" then goto PORT26J
$! 
$! Print at Pole 26J LPS40
$!
$ LAND26J:
$!
$ LPSL 'P1'
$ Wait 00:00:03
$ Goto OUTPUT_MENU
$!
$ PORT26J:
$!
$ LPSP 'P1'
$ Wait 00:00:03
$ Goto OUTPUT_MENU
$!
$!
$ POLE29D:
$!
$ W "''CLR'"
$ W ""
$ W " Selected Report> ''BLD' ''P1' ''NOR'"
$ W ""
$ W " Is now being queued at the Pole 29D LPS40"
$ W ""
$ W " ''PM'"
$ W ""
$ If "''PW'" .eqs. "W" then goto LAND29D
$ If "''PW'" .eqs. "N" then goto PORT29D
$! 
$!
$! Print at Pole 29D LPS40
$!
$ LAND29D:
$!
$ LCL 'P1'
$ Wait 00:00:03
$ Goto OUTPUT_MENU
$!
$ PORT29D:
$!
$ LCP 'P1'
$ Wait 00:00:03
$ Goto OUTPUT_MENU
$!
$!
$ POLE23H:
$!
$ W "''CLR'"
$ W ""
$ W " Selected Report> ''BLD' ''P1' ''NOR'"
$ W ""
$ W " Is now being queued at the Pole 23H LPS40"
$ W ""
$ W " ''PM'"
$ W ""
$ If "''PW'" .eqs. "W" then goto LAND23H
$ If "''PW'" .eqs. "N" then goto PORT23H
$! 
$! Print at Pole 23H LPS40
$!
$ LAND23H:
$!
$ TLL 'P1'
$ Wait 00:00:03
$ Goto OUTPUT_MENU
$!
$ PORT23H:
$!
$ TLP 'P1'
$ Wait 00:00:03
$ Goto OUTPUT_MENU
$!
$!
$! Print on a local LA50
$!
$ LA50:
$ W "''CLR'"
$ W ""
$ W " Selected Report> ''BLD' ''P1' ''NOR'"
$ W ""
$ W " Will now print on your LA50"
$ W ""
$ If "''PW'" .eqs. "W" then goto LA50_132
$ If "''PW'" .eqs. "N" then goto LA50_80
$!
$ LA50_80:
$!
$ Set Terminal/Device=LA100
$ Set terminal/width=80
$ W "''ESC'[5i"                        ! Print port on
$ W "''ESC'[1w"                        ! Print 80 cols
$ W "''FF'"
$ Type 'P1'
$ W "''ESC'[0w"
$ W "''ESC'[4i"                        ! Print port off
$ Set Terminal/Inquire                 ! Re-set terminal
$!
$ Goto OUTPUT_MENU
$!
$ LA50_132:
$!
$!
$ Set Terminal/Device=LA100
$ Set Terminal/Width=132
$ W "''ESC'[5i"                        ! Print port on
$ W "''ESC'[4w"                        ! Print 132 cols
$ W "''FF'"
$ Type 'P1'
$ W "''ESC'[0w"                        ! Return printer to 80 cols
$ W "''ESC'[4i"                        ! Print port off
$ Set Terminal/Inquire                 ! Re-set terminal
$ Set Terminal/Width=80
$!
$ Goto OUTPUT_MENU
$!
$!
$!
$! Print on local LN03
$!
$ LN03:
$ W "''CLR'"
$ W ""
$ W " Selected Report> ''BLD' ''P1' ''NOR'"
$ W ""
$ W " Will now print on your LN03"
$ W ""
$ W " ''PM'"
$ W ""
$ If "''PW'" .eqs. "W" then goto LN03_LAND
$ If "''PW'" .eqs. "N" then goto LN03_PORT
$!
$ LN03_PORT:
$ Set Terminal/Device=LA100
$ W "''ESC'[5i"                        ! Print port on
$ W "''ESC'[1w"                        ! Print 80 cols
$ W "''FF'"
$ Type 'P1'
$ W "''ESC'[!p"
$ W "''ESC'[4i"                        ! Print port off
$ Set Terminal/Inquire                 ! Re-set terminal
$!
$ Goto OUTPUT_MENU
$!
$!
$!
$ LN03_LAND:
$!
$ Set Terminal/Device=LA100
$ W "''ESC'[5i"                        ! Print port on
$ W "''FF'"
$ W "''ESC'[!p"+"''ESC'[1 J"+"''ESC'[4w"+"''ESC'[10;132 s"+"''ESC'[0 L"+ -
"''ESC'[1;66r"+"''ESC'[0;50 G"+"''ESC'[100;70 B"
$ Type 'P1'
$ W "''ESC'[!p"                        ! Re-set LN03
$ W "''ESC'[4i"                        ! Print port off
$ Set Terminal/Inquire                 ! Re-Set video terminal to what it was
$!
$ Goto OUTPUT_MENU
$!
$!
$ VMERR:
$ VMmsg = "You must enter a VAXmail address, try again"
$ VAXMAIL:
$!
$ W "''CLR'"
$ W ""
$ W " ''VMmsg'"
$ W ""
$ Inquire who -
     "''BLD'Enter VAXmail Address - NODE::ACCOUNT''NOR'"
$!
$ If "''who'" .eqs. "" then goto VMERR
$!
$ P2 = "U.S. Fiscal Reporting Report Attached"
$ P3 = "''who'"
$!
$ Mail -
     /Noself -
     /Subject="''P2'" -
     'P1' -
     'P3'
$!
$ Goto OUTPUT_MENU
$!
$! Let's get back to the fex, already in progress
$!
$ ENDALL:
$ Exit