Typical DCL Command Procedure to run the program :
$!
$! THIS COMMAND PROCEDURE RUNS THE PROCESS THAT SENDS OUT
$! THE LIST OF PURCHASE ORDERS THAT HAVE BEEN DESIGNATED AS
$! "CHECK WITH ORDER".
$!
$ DELETE/LOG FR$FEX:*.FTM;*
$ DELETE/LOG FR$FEX:*.MAS;*
$ DELETE/LOG FR$FEX:PLAY.WP;*
$ COPY FR$FEX:FRSMFD1.MFD FR$FEX:*.MAS;
$!
$ DEFINE FOC$DIR1 FR$DATA
$ DEFINE FOC$DIR2 FR$FEX,FR$MFD
$!
$ SET DEFAULT FR$FEX
$ FOCUS
EXEC (FOCEXEC name)
FIN
$!
$! TAKE OUTPUT FROM FOCUS PROGRAM & CREATE REPORT.
$!
$ OPEN/READ input_file FR$FEX:POTMP5.FTM
$ OPEN/WRITE output_file FR$FEX:PLAY.WP
$!
$ TEST_VEN = "***"
$ TEST_PO = "***"
$!
$PROCESS_VEN:
$!
$ READ/END=END_USER input_file in_record
$!
$ VENDOR_NUM = F$EXTRACT(0,11,in_record)
$ PO_NUM = F$EXTRACT(11,7,in_record)
$!
$ IF VENDOR_NUM .NES. TEST_VEN
$ THEN
$ WRITE output_file "**********************************************************"
$ WRITE output_file " "
$ WRITE output_file "Vendor # : " + VENDOR_NUM
$ WRITE output_file "Vendor Name : " + -
F$EDIT(F$EXTRACT(21,30,in_record),"TRIM")
$ WRITE output_file " "
$ TEST_VEN = VENDOR_NUM
$ ENDIF
$!
$ IF PO_NUM .NES. TEST_PO
$ THEN
$ WRITE output_file "PO # : " + PO_NUM + " PO Amt : " + -
F$EDIT(F$EXTRACT(51,13,in_record),"TRIM") + -
" PO Date : " + -
F$EDIT(F$EXTRACT(148,2,in_record),"TRIM") + "/" + -
F$EDIT(F$EXTRACT(150,2,in_record),"TRIM") + "/" + -
F$EDIT(F$EXTRACT(144,4,in_record),"TRIM")
$ WRITE output_file " "
$ TEST_PO = PO_NUM
$ ENDIF
$!
$ DESC_1 = F$EDIT(F$EXTRACT(64,40,in_record),"TRIM")
$ DESC_2 = F$EDIT(F$EXTRACT(104,40,in_record),"TRIM")
$ TEXT_1_DET = F$EDIT(F$EXTRACT(152,40,in_record),"TRIM")
$ TEXT_2_DET = F$EDIT(F$EXTRACT(192,40,in_record),"TRIM")
$ TEXT_3_DET = F$EDIT(F$EXTRACT(232,40,in_record),"TRIM")
$ TEXT_4_DET = F$EDIT(F$EXTRACT(272,40,in_record),"TRIM")
$ TEXT_5_DET = F$EDIT(F$EXTRACT(312,40,in_record),"TRIM")
$ TEXT_6_DET = F$EDIT(F$EXTRACT(352,40,in_record),"TRIM")
$ TEXT_7_DET = F$EDIT(F$EXTRACT(392,40,in_record),"TRIM")
$ TEXT_8_DET = F$EDIT(F$EXTRACT(432,40,in_record),"TRIM")
$!
$ WRITE output_file DESC_1
$ IF DESC_2 .NES. ""
$ THEN
$ WRITE output_file DESC_2
$ ENDIF
$!
$ IF TEXT_1_DET .NES. ""
$ THEN
$ WRITE output_file TEXT_1_DET
$ ENDIF
$!
$ IF TEXT_2_DET .NES. ""
$ THEN
$ WRITE output_file TEXT_2_DET
$ ENDIF
$!
$ IF TEXT_3_DET .NES. ""
$ THEN
$ WRITE output_file TEXT_3_DET
$ ENDIF
$!
$ IF TEXT_4_DET .NES. ""
$ THEN
$ WRITE output_file TEXT_4_DET
$ ENDIF
$!
$ IF TEXT_5_DET .NES. ""
$ THEN
$ WRITE output_file TEXT_5_DET
$ ENDIF
$!
$ IF TEXT_6_DET .NES. ""
$ THEN
$ WRITE output_file TEXT_6_DET
$ ENDIF
$!
$ IF TEXT_7_DET .NES. ""
$ THEN
$ WRITE output_file TEXT_7_DET
$ ENDIF
$!
$ IF TEXT_8_DET .NES. ""
$ THEN
$ WRITE output_file TEXT_8_DET
$ ENDIF
$ WRITE output_file " "
$!
$ IF F$EXTRACT(18,3,in_record) .EQS. "000"
$ THEN
$ READ/END=END_USER input_file in_record
$ ENDIF
$!
$ GOTO PROCESS_VEN
$!
$END_USER:
$!
$ CLOSE input_file
$ CLOSE output_file
$!
$ MAIL/SUBJECT="(FOCEXEC name) - PO Check With Order List" FR$FEX:PLAY.WP (VMS mail id)
$!
$ EXIT
FOCUS program :
SET PAGE = NOPAGE
JOIN CLEAR *
-*
-* Retrieve all purchase orders that have been designated as
-* "check with order".
-*
DEFINE FILE POFILE
CHK_PO/A1=EDIT(PO_NUM,'9');
FILLER_SP1/A99=' ';
FILLER_SP2/A99=' ';
FILLER_SP3/A99=' ';
FILLER_SP4/A24=' *';
FILLER_SP5/A1='*';
DUM_LINE_NUM/A3='000';
END
-*
-* Retrieve all purchase orders that do not have any verbiage
-* in text lines 1-8.
-*
TABLE FILE POFILE
PRINT PO_NUM TOTAL_AMT LINE_NUM_DET DESC_1 DESC_2 PO_DT
FILLER_SP1 FILLER_SP2 FILLER_SP3 FILLER_SP4
BY VENDOR_NUM
ON TABLE SAVE AS POTMP1
WHERE IN_PROC_FLAG_HDR EQ '0';
WHERE PRINT_CODE EQ '';
WHERE CHK_PO EQ 'P';
WHERE DELETE_FLAG_HDR EQ '0';
WHERE PO_TYPE EQ 'CW';
END
-*
-* Retrieve all purchase orders that do have verbiage
-* in text lines 1-8.
-*
TABLE FILE POFILE
PRINT PO_NUM TOTAL_AMT DUM_LINE_NUM DESC_1 DESC_2 PO_DT TEXT_1_DET TEXT_2_DET
TEXT_3_DET TEXT_4_DET TEXT_5_DET TEXT_6_DET TEXT_7_DET
TEXT_8_DET FILLER_SP5
BY VENDOR_NUM
ON TABLE SAVE AS POTMP2
WHERE IN_PROC_FLAG_HDR EQ '0';
WHERE PRINT_CODE EQ '';
WHERE CHK_PO EQ 'P';
WHERE DELETE_FLAG_HDR EQ '0';
WHERE PO_TYPE EQ 'CW';
END
-RUN
-VMS COPY POTMP1.FTM,POTMP2.FTM POTMP3.FTM
-*
-* Retrieve vendor information for the purchase orders.
-*
FILEDEF FRSMFD1 DISK POTMP3.FTM
TABLE FILE FRSMFD1
PRINT PO_NUM TOTAL_AMT LINE_NUM_DET DESC_1 DESC_2 PO_DT TEXT_1_DET
TEXT_2_DET TEXT_3_DET TEXT_4_DET TEXT_5_DET TEXT_6_DET TEXT_7_DET
TEXT_8_DET REC_END
BY VENDOR_NUM
ON TABLE HOLD AS POTMP4
END
-*
JOIN VENDOR_NUM IN POTMP4 TO VENDOR_NUM IN VNFILE AS J1
TABLE FILE POTMP4
PRINT VENDOR_NAME TOTAL_AMT DESC_1 DESC_2 PO_DT TEXT_1_DET
TEXT_2_DET TEXT_3_DET TEXT_4_DET TEXT_5_DET TEXT_6_DET TEXT_7_DET
TEXT_8_DET REC_END
BY VENDOR_NUM
BY PO_NUM
BY LINE_NUM_DET
ON TABLE SAVE AS POTMP5
END
JOIN CLEAR *
Master File Description (MFD) for FRSMFD1 :
FILE=FRSMFD1,SUFFIX=FIX
SEGNAME=ROOT
FIELDNAME=VENDOR_NUM,,A11,A11,$
FIELDNAME=PO_NUM,,A07,A07,$
FIELDNAME=TOTAL_AMT,,A13,A13,$
FIELDNAME=LINE_NUM_DET,,A03,A03,$
FIELDNAME=DESC_1,,A40,A40,$
FIELDNAME=DESC_2,,A40,A40,$
FIELDNAME=PO_DT,,A08,A08,$
FIELDNAME=TEXT_1_DET,,A40,A40,$
FIELDNAME=TEXT_2_DET,,A40,A40,$
FIELDNAME=TEXT_3_DET,,A40,A40,$
FIELDNAME=TEXT_4_DET,,A40,A40,$
FIELDNAME=TEXT_5_DET,,A40,A40,$
FIELDNAME=TEXT_6_DET,,A40,A40,$
FIELDNAME=TEXT_7_DET,,A40,A40,$
FIELDNAME=TEXT_8_DET,,A40,A40,$
FIELDNAME=REC_END,,A01,A01,$
This page hosted by
Get your own Free Homepage