The new code is as follows:
-***********************************************************************
-* FOCEXEC: GIMME18 * *
-* *
-* REMARKS. THIS PROGRAM PROMPTS THE USER FOR A BLANKET NUMBER AND *
-* PULLS OFF ALL OF THE BLANKET ITEMS AND PUTS THEM IN A HOLD FILE. *
-* IT THEN PULLS OFF ALL THE SELECTED PLANTS INFORMATION FROM THE *
-* CPRCATLG FILE. THE 31 AND 21 TRANSACTIONS ARE COUNTED BY MONTH *
-* FROM THE GENSHIST FILE. THE 3 HOLD FILES ARE JOINED AND THE *
-* DOWNLOAD FILE (GIMME18.DATA) IS CREATED. *
-* *
-* FILES USED: CPRBLANK,CPRCATLG,AND GENSHIST *
-* *
-* AUTHOR: LAURA MOORE *
-* *
-* DATE: JULY 7, 1997 *
-* *
-***********************************************************************
-* *
-* REMARKS: THIS FILE WILL ONLY BE RUN BY FORD PERSONNEL. THE *
-* BUYER CODE INFORMATION USED TO VERIFY SUPPLIER ACCESS, HAS BEEN *
-* REMOVED. *
-* *
-* AUTHOR: PAT PARIS *
-* *
-* DATE: OCTOBER 2, 1997 *
-* *
-***********************************************************************
-*-SET &ECHO = ON;
SET PF01=RETURN,PF02=RETURN,PF03=RETURN,PF04=RETURN,PF05=RETURN
SET PF06=RETURN,PF07=RETURN,PF08=RETURN,PF09=RETURN,PF10=RETURN
SET PF11=RETURN,PF12=RETURN,PF13=RETURN,PF14=RETURN,PF15=RETURN
SET PF16=RETURN,PF17=RETURN,PF18=RETURN,PF19=RETURN,PF20=RETURN
SET PF21=RETURN,PF22=RETURN,PF23=RETURN,PF24=RETURN
SET MSG=OFF
SET ALL=OFF
SET NODATA=0
SET PRINT=ONLINE
SET PANEL=0
-RUN
-START
-SET &PFKEY=' ';
-SET &&DIV=' ';
-SET &&PLT=' ';
-SET &BLKT=' ';
-SET &XYZ=' ';
-SET &ERRMSG=' ';
-***PUT UP FORM FOR DATA ENTRY AND THEN VERIFY ALL
-FORM_1
-RUN
-CRTFORM TYPE 1 LINE 1
-"GIMME18"
-" "
-" "
-" SUPPLIER IM INFORMATION SYSTEM "
-" CMS INVENTORY DOWNLOAD "
-" "
-" "
-" "
-"<.Y. <3 DIVISION: <.IBT.&&DIV "
-" "
-"<.Y. <3 PLANT : <.IBT.&&PLT "
-" "
-"<.Y. <3 BLANKET: <.IBT.&BLKT "
-" "
-"<.P. "
-" "
-" "
-"<.R. <10 PF3=END ENTER=PROCESS "
-" "
-"<.YD.&ERRMSG/50>"
-************VERIFY APPROPRIATE KEY AND DATA ENTERED
-IF &PFKEY EQ 'PF03' GOTO THEEND;
-IF &&DIV EQ ' ' GOTO NO_DATA;
-IF &&PLT EQ ' ' GOTO NO_DATA;
-IF &BLKT EQ ' ' GOTO NO_DATA;
-IF &PFKEY EQ 'ENTR' GOTO DO_RPT;
-SET &ERRMSG='PLEASE USE PF3 OR THE ENTER KEY';
-GOTO FORM_1;
-NO_DATA
-SET &ERRMSG='PLEASE ENTER A TSOID,PLANT,DIVISION CODE & BLANKET #';
-GOTO FORM_1
-DO_RPT
-TYPE PROCESSING. PLEASE WAIT..
-*
-***********ALLOCATE FILE TO HOLD CMS BLANKET INFORMATION
-? TSO DDNAME BLANKH
-IF &DSNAME EQ ' ' GOTO BLANK_LABEL;
DYNAM FREE DDNAME BLANKH
-BLANK_LABEL
DYNAM ALLOC FILE BLANKH SPACE 320 60 CYL
-RUN
-*
JOIN CLEAR *
DEFINE FILE CPRBLANK
PLT_ITEM/A17=PLANT | ITEMNUM;
END
-*
TABLE FILE CPRBLANK
PRINT *
BY PLT_ITEM
WHERE DIV EQ '&&DIV'
WHERE PLANT EQ '&&PLT'
WHERE BLNKTNUM EQ '&BLKT'
ON TABLE HOLD AS BLANKH FORMAT FOCUS INDEX PLT_ITEM
END
-RUN
-IF &LINES EQ 0 GOTO NO_BLANK;
-*
-***********************************************************************
-************************SET UP DOWNLOAD FILE***************************
EX GIMMEDWN REP_NAME='GIMME18'
-RUN
-***********ALLOCATE FILE TO HOLD CMS CATALOG INFORMATION
-? TSO DDNAME CATH
-IF &DSNAME EQ ' ' GOTO CAT_LABEL;
DYNAM FREE DDNAME CATH
-CAT_LABEL
DYNAM ALLOC FILE CATH SPACE 320 60 CYL
-RUN
-*
JOIN CLEAR *
TABLE FILE CPRCATLG
PRINT DTE_LAST_REQ
USING_DEPT
AUTO_ORDER
DTE_ISSUE
ITEM_DESC
BY PLANT_ITEM
WHERE DIV EQ '&&DIV'
WHERE PLANT EQ '&&PLT'
ON TABLE HOLD AS CATH FORMAT FOCUS INDEX PLANT_ITEM
END
-RUN
-*-----------------------------------------------------------------------
-*-PUT ALL IN ONE TABLE,THEN GET MONTHLY TRANSACTION COUNTS FROM GENSHIST
-*-----------------------------------------------------------------------
-TYPE
-TYPE BUILDING TRANSACTION COUNT INFORMATION.
-TYPE THIS PHASE MAY BE LONG RUNNING... PLEASE WAIT...
EX GIMMDAT
-RUN
-*
JOIN CLEAR *
JOIN PLT_ITEM IN BLANKH TO PLT_ITEM IN GENSHOLD AS JOIN6
JOIN PLT_ITEM IN BLANKH TO PLANT_ITEM IN CATH AS J1
DEFINE FILE BLANKH ADD
-*----------------------------
-* DETERIME THE CURRENT MONTH
-*----------------------------
-SET &MM = EDIT(&MDY,99$$$$);
-SET &CNTR = 1;
-SET &X = 1;
-*----------------------------------------------------------------------
-* GET RUNNING 12 MONTHS WORTH OF DATA FOR 3MO,6MO AND 1YEAR AVERAGES.
-* SET UP THE PRIOR MONTH VALUES (&MONTH1 FOR JAN .. &MONTH12 FOR DEC)
-*----------------------------------------------------------------------
-LOOP
-IF &X GT 12 GOTO ENDLOOP;
-SET &RELMM = &MM - &CNTR;
-SET &MONTH.&X = IF &RELMM LE 0 THEN (&RELMM + 12) ELSE &RELMM;
-SET &CNTR = &CNTR + 1;
-SET &X = &X + 1;
-GOTO LOOP
-ENDLOOP
-*-----------------------------------------------------------------------
-* SET THE VARIABLE &VALXXX (WHERE XXX=MONTH) TO THE VALUE OF THE PRIORXX
-* FIELD NAME IN THE DATABASE WHICH THE NEW FIELD NAMES WILL BE
-* SET TO
-*-----------FIND WHERE EACH MONTH'S DATA RESIDES THIS MONTH
-SET &VALJAN = IF &MONTH1 EQ 1 THEN PRIMTH1 ELSE PRIMTH||&MONTH1;
-SET &VALFEB = IF &MONTH2 EQ 1 THEN PRIMTH1 ELSE PRIMTH||&MONTH2;
-SET &VALMAR = IF &MONTH3 EQ 1 THEN PRIMTH1 ELSE PRIMTH||&MONTH3;
-SET &VALAPR = IF &MONTH4 EQ 1 THEN PRIMTH1 ELSE PRIMTH||&MONTH4;
-SET &VALMAY = IF &MONTH5 EQ 1 THEN PRIMTH1 ELSE PRIMTH||&MONTH5;
-SET &VALJUN = IF &MONTH6 EQ 1 THEN PRIMTH1 ELSE PRIMTH||&MONTH6;
-SET &VALJUL = IF &MONTH7 EQ 1 THEN PRIMTH1 ELSE PRIMTH||&MONTH7;
-SET &VALAUG = IF &MONTH8 EQ 1 THEN PRIMTH1 ELSE PRIMTH||&MONTH8;
-SET &VALSEP = IF &MONTH9 EQ 1 THEN PRIMTH1 ELSE PRIMTH||&MONTH9;
-SET &VALOCT = IF &MONTH10 EQ 1 THEN PRIMTH1 ELSE PRIMTH||&MONTH10;
-SET &VALNOV = IF &MONTH11 EQ 1 THEN PRIMTH1 ELSE PRIMTH||&MONTH11;
-SET &VALDEC = IF &MONTH12 EQ 1 THEN PRIMTH1 ELSE PRIMTH||&MONTH12;
-*
-* DEFINE THE NEW FIELDS: GET USAGE FIGURES
-*
CURRNT_USAGE = MTDUSAGE;
JAN_USAGE/P15 = &VALJAN;
FEB_USAGE/P15 = &VALFEB;
MAR_USAGE/P15 = &VALMAR;
APR_USAGE/P15 = &VALAPR;
MAY_USAGE/P15 = &VALMAY;
JUN_USAGE/P15 = &VALJUN;
JUL_USAGE/P15 = &VALJUL;
AUG_USAGE/P15 = &VALAUG;
SEP_USAGE/P15 = &VALSEP;
OCT_USAGE/P15 = &VALOCT;
NOV_USAGE/P15 = &VALNOV;
DEC_USAGE/P15 = &VALDEC;
-*******************************************
-******** CALCULATIONS
DIV_PLANT/A3=DIV | PLANT;
ANNUAL_USAGE/P15=(JAN_USAGE + FEB_USAGE + MAR_USAGE + APR_USAGE
+ MAY_USAGE + JUN_USAGE + JUL_USAGE + AUG_USAGE + SEP_USAGE
+ OCT_USAGE + NOV_USAGE + DEC_USAGE);
12_MTH_USAGE/P15=(PRIMTH1 + PRIMTH2 + PRIMTH3 + PRIMTH4 + PRIMTH5
+ PRIMTH6 + PRIMTH7 + PRIMTH8 + PRIMTH9 + PRIMTH10
+ PRIMTH11 + PRIMTH12);
6_MTH_USAGE/P15=(PRIMTH1 + PRIMTH2 + PRIMTH3 + PRIMTH4 +
PRIMTH5 + PRIMTH6);
3_MTH_USAGE/P15=(PRIMTH1 + PRIMTH2 + PRIMTH3);
AVG12MO/P15=(12_MTH_USAGE / 12);
AVG6MO/P15=(6_MTH_USAGE / 6);
AVG3MO/P15=(3_MTH_USAGE / 3);
-******** CALCULATE MONTH SUPPLY
MON_SUP/P15=(BOH / AVG3MO);
-*TODAY/MDY='&MDY';
TK_DTE/MDY = '&DATE';
TL_DTE/A6MDY = TK_DTE;
TZ_DTE/A17 = CHGDAT('MDY','MDYY', TL_DTE, 'A17');
TODAY/I8MDYY = EDIT(TZ_DTE);
Y_DTE/A6 = EDIT(DTE_LAST_REQ);
Z_DTE/A17 = CHGDAT('YMD', 'MDYY', Y_DTE, 'A17');
LAST_REQ_DTE/I8MDYY = EDIT(Z_DTE);
T_DTE/A6 = EDIT(DTE_ISSUE);
X_DTE/A17 = CHGDAT('YMD','MDYY', T_DTE, 'A17');
ISSUE_DTE/I8MDYY = EDIT(X_DTE);
CURRPRCE/P15.2 = CURRPRCE;
PRIYEAR3/P15 = PRIYEAR3;
PRIYEAR2/P15 = PRIYEAR2;
PRIYEAR1/P15 = PRIYEAR1;
MTDUSAGE/P15 = MTDUSAGE;
END
-*
TABLE FILE BLANKH
PRINT TODAY
DIV_PLANT
BLNKTNUM
STATUS
CMDTYCD
SUPPLCDE
STOCKLOC
ISSUE_DTE
ITEMNUM
UNITMEAS
MCC
ITEM_DESC
PRIYEAR3
PRIYEAR2
PRIYEAR1
JAN_USAGE
FEB_USAGE
MAR_USAGE
APR_USAGE
MAY_USAGE
JUN_USAGE
JUL_USAGE
AUG_USAGE
SEP_USAGE
OCT_USAGE
NOV_USAGE
DEC_USAGE
ANNUAL_USAGE
AVG12MO
AVG6MO
AVG3MO
MTDUSAGE
LAST_REQ_DTE
BOH
CURRPRCE
MON_SUP
MXORDQTY
ITMSFLVL
AUTO_ORDER
USING_DEPT
ITMLEAD
TRGDYSPL
GENSHOLD.E02 GENSHOLD.E03 GENSHOLD.E04 GENSHOLD.E05 GENSHOLD.E06
GENSHOLD.E07 GENSHOLD.E08 GENSHOLD.E09 GENSHOLD.E10 GENSHOLD.E11
GENSHOLD.E12 GENSHOLD.E13
WHERE DIV EQ '&&DIV'
WHERE PLANT EQ '&&PLT'
WHERE BLNKTNUM EQ '&BLKT'
ON TABLE SAVE AS DOWNLOAD FORMAT DIF
END
-RUN
-*
-SET &ERRMSG=IF &LINES NE 0 THEN 'DATA SUCCESSFULLY TRANSFERRED TO FILE';
-*---------SET ERROR MESSAGES AND DISPLAY ON CRTFORM
-NO_BLANK
-IF &LINES NE 0 THEN GOTO FORM_1;
-SET &ERRMSG='NO ITEMS FOUND FOR THIS SEARCH CRITERIA';
-GOTO FORM_1
-NO_SUPPL
-SET &ERRMSG='THERE ARE NO SUPPLIERS FOR THIS BUYER CODE ';
-GOTO FORM_1
-THEEND
END
-RUN
-*>>>>>>>>>>GIMMDAT progaram follows:
-*SET &ECHO=ALL;
-*SET MSG=ON
-RUN
-*-------------GET LAST YEAR'S DATE AND BUILD A DATE RANGE
-*
-SET &YEAR_AGO=AYMD(&YMD,-365,'I8');
-*----CONVERT DATE RANGE TO JULIAN
-*
-SET &IFDT1=&YEAR_AGO;
-SET &IN_MO=EDIT(&IFDT1,'$$$$99$$');
-SET &IN_YR=EDIT(&IFDT1,'$$99$$$$');
-SET &CONV1=&IN_YR||&IN_MO|| '01';
-*
-* REVISE HANDLING OF JULIAN DATE FOR Y2K
-*
-SET &JUL_FROM=JULDAT(&CONV1,'I7');
-*
-SET &IFDT2=&YMD;
-SET &IN_MO2=EDIT(&IFDT2,'$$99$$');
-SET &IN_YR2=EDIT(&IFDT2,'99$$$$');
-SET &CONV2=&IN_YR2||&IN_MO2|| '01';
-*
-SET &JUL_TO=JULDAT(&CONV2,'I7');
-SET &JUL_FR_Y2K2 = &JUL_FROM;
-SET &JUL_TO_Y2K2 = &JUL_TO;
-*
-RUN
-*-----------GET INFO FROM GENSHIST USING ABOVE 12 MONTH DATE RANGE
-*
DEFINE FILE GENSHIST
DIVPLT/A3=DIV|PLANT;
PLT_ITEM/A17=PLANT|ITEMNUM;
-*
TRAN_DTE_YMD/I6YMD=GREGDT(TRANDATE,'I6YMD');
TRAN_DTE_MM/A2 = EDIT(TRAN_DTE_YMD,'$$99$$');
TRANS_MM/I2 = EDIT (TRAN_DTE_MM);
-*
COUNT_TRANS/I6 WITH ITEMNUM =1;
-*** BEGIN YEAR2000 CHANGES **********
TRANDATE_I5_Y2K2/I5 = TRANDATE;
TRANDATE_I6_Y2K2/I6 = GREGDT(TRANDATE_I5_Y2K2,TRANDATE_I6_Y2K2);
TRANDATE_I7_Y2K2/I7 = JULDAT(TRANDATE_I6_Y2K2,TRANDATE_I7_Y2K2);
-*** END YEAR2000 CHANGES **********
-* DEFINE THE MONTH COUNTS DON'T FORGET YOUR ';'
TRAN_MM1/I5 =IF TRANS_MM/I2 EQ &JUL_FROM THEN 1 ELSE 0;
TRAN_MM2/I5 =IF TRANS_MM/I2 EQ AYM(&JUL_FROM,1,'I6YYM') THEN 1 ELSE 0;
TRAN_MM3/I5 =IF TRANS_MM/I2 EQ AYM(&JUL_FROM,2,'I6YYM') THEN 1 ELSE 0;
TRAN_MM4/I5 =IF TRANS_MM/I2 EQ AYM(&JUL_FROM,3,'I6YYM') THEN 1 ELSE 0;
TRAN_MM5/I5 =IF TRANS_MM/I2 EQ AYM(&JUL_FROM,4,'I6YYM') THEN 1 ELSE 0;
TRAN_MM6/I5 =IF TRANS_MM/I2 EQ AYM(&JUL_FROM,5,'I6YYM') THEN 1 ELSE 0;
TRAN_MM7/I5 =IF TRANS_MM/I2 EQ AYM(&JUL_FROM,6,'I6YYM') THEN 1 ELSE 0;
TRAN_MM8/I5 =IF TRANS_MM/I2 EQ AYM(&JUL_FROM,7,'I6YYM') THEN 1 ELSE 0;
TRAN_MM9/I5 =IF TRANS_MM/I2 EQ AYM(&JUL_FROM,8,'I6YYM') THEN 1 ELSE 0;
TRAN_MM10/I5 =IF TRANS_MM/I2 EQ AYM(&JUL_FROM,9,'I6YYM') THEN 1
ELSE 0 ;
TRAN_MM11/I5 =IF TRANS_MM/I2 EQ AYM(&JUL_FROM,10,'I6YYM') THEN 1
ELSE 0 ;
TRAN_MM12/I5 =IF TRANS_MM/I2 EQ AYM(&JUL_FROM,11,'I6YYM') THEN 1
ELSE 0;
-*
END
TABLE FILE GENSHIST
SUM TRAN_MM1 TRAN_MM2 TRAN_MM3 TRAN_MM4 TRAN_MM5 TRAN_MM6
TRAN_MM7 TRAN_MM8 TRAN_MM9 TRAN_MM10 TRAN_MM11 TRAN_MM12
BY PLT_ITEM
-*ACROSS TRANS_MM
WHERE DIV EQ '&&DIV'
WHERE PLANT EQ '&&PLT'
WHERE TRANCODE EQ '21' OR '31'
-*
-******OMIT EXPENSE ITEMS
-*
WHERE ITEMNUM OMITS 'MISC'
-*
-*GET DATES FROM XX/01/LAST YEAR,THRU END OF PREVIOUS MONTH THIS YEAR
-*
WHERE TRANDATE_I7_Y2K2 GE &JUL_FR_Y2K2
WHERE TRANDATE_I7_Y2K2 LT &JUL_TO_Y2K2
ON TABLE HOLD AS GENSHOLD FORMAT FOCUS INDEX PLT_ITEM
END
-RUN
-EXIT
When i am running this code i am getting the follwing error
ERROR AT OR NEAR LINE 277 IN PROCEDURE GIMME18FOCEXEC
(FOC003) THE FIELDNAME IS NOT RECOGNIZED: GENSHOLD.EO7
BYPASSING TO END OF COMMAND
Please assist.
Thanks
focus on mainframe client
Windows
Excel