HP3000-L Archives

March 2004, 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:
"Johnson, Tracy" <[log in to unmask]>
Reply To:
Johnson, Tracy
Date:
Tue, 9 Mar 2004 14:40:07 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (105 lines)
This is a MANMAN specific write-up but there are
extensive MPEX commands used in a job, hence this
is also copied to HP3000-L.  (And some on HP3000-L
may be former MANMAN users.)

Due to the infinite wisdom of our company we have 
a separate division that uses the same database as 
another division, the only difference being the 
Product Line.  So what they did, was add a Sales
Category so they can tell the difference.

When it comes to Invoicing, naturally the two 
divisions want to segregate their Invoices on
separate forms (ha ha.)  They "could" manually
print Invoices for one division, then later 
use the ALL function of printing Invoices to
clear the IFILE.  Then they would have to toss 
out Invoices that were previously printed on 
the other division's form.

Too labor intensive and a waste of paper.

I came up with the following job using MPEX to
read each Invoice number from the IFILE and
compare it to the Sales Category in the database.

If a match occurrs it prints the Invoice using 
MANMAN, then overwrites the IFILE record with 
spaces over the Invoice number.

When done, it goes into an editor, (QUAD) and
deletes all the blank lines created by writing
the spaces from the 2nd record to the last.

Lastly it re-writes record 0 with the Integer
in the proper place so that MANMAN is told
the new number of Invoices to be printed.

The question is, can anyone see a flaw in the 
job?

(It is intended to run at a time when no one
else is accessing IFILE, and OM,UT,909 is 
already a custom version of OM,UT,900.)

IFILE is a 5W file flat FB file.
The application password was x'ed out.

- - - - - - - - - TEAR LINE - - - - - - - - - - -

::SETVAR MPEXTELLBACK "!!HPUSER.!!HPACCOUNT"
!JOB VEUT909,MANAGER.{hpaccount};INPRI=13;OUTCLASS=,1;SPSAVE
!EXCLUDE
!RUN MAIN.PUB.VESOFT;PARM=1
SETVAR J VEFINFO("IFILE.FDATABAS").EOF
SETVAR K !J-1
FCOPY FROM=IFILE/LOCK.FDATABAS;TO=;HEX;CHAR
SETVAR FNUM VEFOPEN("IFILE/LOCK.FDATABAS,OLD;SHR;ACC=INOUT")
SETVAR CONTROL VEFREADDIR(fnum,0)
SETVAR GARBAGE CONTROL[2:8]
SETVAR DBID VEDBOPEN("FINDB.FDATABAS,READ,5")
REPEAT
   SETVAR RECORD VEFREADDIR(fnum,!i)
   SETVAR REFNUM LFT("!RECORD",10)
   IF VEDBFIND(DBID,"ARFIL","REFNUM","!REFNUM")
      SETVAR SONUM VEDBGET(DBID,"ARFIL",5,"SONUM")
      IF VEDBFIND(DBID,"SOEFIL","SONUM","!SONUM")
         SETVAR SALECODE VEDBGET(DBID,"SOEFIL",5,"SOESCT")
         CALC SALECODE
         IF SALECODE = "CONP" THEN
            RUN SYSMAN.PUB.MMV110;INFO="OM";XL="!SYSMANXLPATH,!DISCXLADD";&
            INPUT="xxxxx";INPUT="UT,909";INPUT="Y";INPUT="!REFNUM";INPUT="N";&
            INPUT="2";INPUT="1041";INPUT="3";INPUT="";INPUT="Y";INPUT="N";&
            INPUT="E";INPUT="E";INPUT="E"
            CALC VEFWRITEDIR(fnum,"          ",!i)
         ENDIF
         ECHO !REFNUM !SONUM !SALECODE
      ENDIF
   ENDIF
FORNUM I=1,!K
CALC VEFCLOSE(!fnum)
RUN QUAD.PUB.VESOFT;LIB=P
T IFILE/LOCK.FDATABAS
DEBLANK 2/LAST
KEEP
YES
EXIT
ALTFILE IFILE.FDATABAS;LOCK=LOCK;DELACD;LOCAL
SETVAR J VEFINFO("IFILE.FDATABAS").EOF - 1
SETVAR FNUM VEFOPEN("IFILE/LOCK.FDATABAS,OLD;SHR;ACC=INOUT")
IF J = 1 THEN
   SETVAR NEW_CONTROL STRWRITE(0:'I2') + GARBAGE
   CALC VEFWRITEDIR(fnum,"!REFNUM",1)
ELSE
   SETVAR NEW_CONTROL STRWRITE(J:'I2') + GARBAGE
ENDIF
CALC VEFWRITEDIR(fnum,NEW_CONTROL,0)
CALC VEFCLOSE(!fnum)
FCOPY FROM=IFILE/LOCK.FDATABAS;TO=;HEX;CHAR
EXIT
!EOJ

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2