Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Page 1 2 

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Hold with Join
 Login/Join
 
Silver Member
posted
Hi,
I have a program which generates a report by joining the columns fetched from three different tables.

The third table has transactions for some plants over the year. Now the program takes the data from last 12 months across each month and holds the data on a hold file.

For all other plants the data is present for over an year so there is no problem in fetching the data.
But there are few plants which are launched only in August 2007. Hence the transaction data for these two plants is not available from Jan to July in the table.

The problem is when any body is trying to run the report. The report is running properly for all plants except the two plants launched in august. The program throws an error at the line where it tries to print 5th row for those two plants.

The code which fetches the data from the third table is:

TABLE FILE GENSHIST
SUM COUNT
BY PLT_ITEM
ACROSS TRANS_MM
WHERE DIV EQ '&&DIV'
WHERE PLANT EQ '&&PLT'
WHERE TRANCODE EQ '21' OR '31'
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

The final print is here:

TABLE FILE BLANKH
PRINT TODAY
DIV_PLANT
BLNKTNUM
STATUS
CMDTYCD
SUPPLCDE
STOCKLOC
ISSUE_DTE
ITEMNUM
GENSHOLD.E02 GENSHOLD.E03 GENSHOLD.E04 GENSHOLD.E05 GENSHOLD.E06
GENSHOLD.E07 GENSHOLD.E08 GENSHOLD.E09 GENSHOLD.E10 GENSHOLD.E11
GENSHOLD.E12 GENSHOLD.E13
Im getting error as foc003 for the field GENSHOLD.E06.

Please let me know what can be done so that the report runs properly for these plants also with null values in the fields starting from GENSHOLD.E06.

Please revert me for any concerns.


Thanks

focus on mainframe client
Windows
Excel
 
Posts: 33 | Registered: December 14, 2007Report This Post
Master
posted Hide Post
When you are doing an across, and there is nodata for the month the field is not created. Therefore, you only have fields E01 THRU E05. Try
DEFINE FILE BLANKH
JAN/D12=IF TRANS_MM EQ 1 THEN 1 ELSE 0;
FEB/D12=IF TRANS_MM EQ 2 THEN 1 ELSE 0;
(etc)
END
TABLE FILE BLANKH
SUM
JAN FEB ... DEC
BY PLT_ITEM
(etc)
END


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Silver Member
posted Hide Post
Thanks Pat, The logic here is some what different.

These fields are referred from a hold as genshold. And also this is not about Jan to Dec. The program goes back 12 months and divides the dates into months as trans_mm. Suppose the program is run in march it goesback to march of previous year and prints the count from march.

The code

TABLE FILE GENSHIST
SUM COUNT
BY PLT_ITEM
ACROSS TRANS_MM
WHERE DIV EQ '&&DIV'
WHERE PLANT EQ '&&PLT'
WHERE TRANCODE EQ '21' OR '31'
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

is in a subroutine called GIMMDAT which is called from GIMME18 which contains the code

JOIN CLEAR *
JOIN PLT_ITEM IN BLANKH TO PLT_ITEM IN GENSHOLD AS JOIN6
.
DEFINE FILE BLANKH ADD
.
.
.
TABLE FILE BLANKH
PRINT TODAY
DIV_PLANT
BLNKTNUM
STATUS
CMDTYCD
SUPPLCDE
.
.
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
Please assist.


Thanks

focus on mainframe client
Windows
Excel
 
Posts: 33 | Registered: December 14, 2007Report This Post
Master
posted Hide Post
Put:
-RUN
?FF GENSHOLD
-EXIT
after your step that builds GENSHOLD. If I am understanding you correctly, GENHIST holds the data from the third plant that began operations in Aug 2007. So you don't have data from Dec 2006 thru Jul 2007. You would only have your PLT_ITEM (E01), Aug (E02), Sep (E03), Oct (E04) and Nov (E05). If this assumption is correct, somewhere you have to initialize your fields. Jan in my example doesn't necessarily have to be Jan it could be TRANS_MM1 where TRANS_MM is equal to the first month of your request (&JUL_FR_Y2K2) and TRAN_MM2/I5 =IF TRANS_MM EQ AYM(&JUL_FR_Y2K2,1,'I6YYM') THEN 1 ELSE 0. If I have made and invalid assumption, please post the output from the ?FF GENSHOLD so that we can see what your MFD is.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Silver Member
posted Hide Post
Pat, I am getting the following output after ?ff genshold

FILENAME= GENSHOLD

PLT_ITEM E01 A17
COU1 E02 I6
COU2 E03 I6
COU3 E04 I6
COU4 E05 I6

ERROR AT OR NEAR LINE 291 IN PROCEDURE GIMME18FOCEXEC
(FOC003) THE FIELDNAME IS NOT RECOGNIZED: GENSHOLD.E06
BYPASSING TO END OF COMMAND
(FOC009) INCOMPLETE REQUEST STATEMENT

Please assist.

Thanks


Thanks

focus on mainframe client
Windows
Excel
 
Posts: 33 | Registered: December 14, 2007Report This Post
Master
posted Hide Post
Look at your file definition for GENSHOLD and then go back and review what I have said in my previous post. You are getting an error when you try to print GENSHOLD.E06 because there is no such field in your hold file. To force these fields (E06 through E13) to exist, you have to initialize them with either a compute or a define.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Silver Member
posted Hide Post
Hi Pat,

I have defined the file GENSHOLD after the line
"TABLE FILE GENSHIST
SUM COUNT
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"

as

DEFINE FILE GENSHOLD
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

But when i execute it i get the following error at the first line of define file genshold line.

as

(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: TRANS_MM

FILENAME= GENSHOLD

PLT_ITEM E01 A17
COU1 E02 I6
COU2 E03 I6
COU3 E04 I6
COU4 E05 I6


Please assist.


Thanks

focus on mainframe client
Windows
Excel
 
Posts: 33 | Registered: December 14, 2007Report This Post
Silver Member
posted Hide Post
In my previous post i have used (&JUL_FROM) instead of (&JUL_FR_Y2K2). Iam getting the same error for both.

Please assist


Thanks

focus on mainframe client
Windows
Excel
 
Posts: 33 | Registered: December 14, 2007Report This Post
Silver Member
posted Hide Post
Genshold is a file which is created by the HOLD keyword.. How to initialize it ? I am confused.


Thanks

focus on mainframe client
Windows
Excel
 
Posts: 33 | Registered: December 14, 2007Report This Post
Gold member
posted Hide Post
Just an idea....

You could start by changing...this
TRANS_MM/I2 to TRANS_MM.

Just remove the dynamic reformating.
I don't think you want to do that in a define.


WebFocus 7x, 8x, Win / Linux, any output format
 
Posts: 70 | Location: reading, pa | Registered: April 07, 2007Report This Post
Silver Member
posted Hide Post
Thanks for your Idea..

I am still getting the same error.

Please advise.


Thanks

focus on mainframe client
Windows
Excel
 
Posts: 33 | Registered: December 14, 2007Report This Post
Master
posted Hide Post
What you need to do is to create a .mas that is the layout you want for GENSHOLD. The file type should be FOC. Then instead of using ON TABLE HOLD AS GENSHOLD, just use ON TABLE HOLD. Then use MODIFY to load GENSHOLD from the transactions in the HOLD file.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Silver Member
posted Hide Post
Thanks for the update,

I am new to focus. I will create the mas file for GENSHOLD but i dont know how to use MODIFY to load GENSHOLD from the transactions in the HOLD file.

Can you please help me with an example ?


Thanks

focus on mainframe client
Windows
Excel
 
Posts: 33 | Registered: December 14, 2007Report This Post
Master
posted Hide Post
Sorry I haven't gotten back to you sooner.
Your problem isn't with GENHOLD, it is with GENHIST. Move your define up to GENHIST. THEN:
TABLE FILE GENHIST
SUM TRAN_MM1 TRAN_MM2 TRAN_MM3 (etc)
BY PLT_ITEM 
WHERE DIV EQ '&&DIV' 
WHERE PLANT EQ '&&PLT' 
WHERE TRANCODE EQ '21' OR '31' 
WHERE TRANDATE_I7_Y2K2 GE &JUL_FR_Y2K2 
WHERE TRANDATE_I7_Y2K2 LT &JUL_TO_Y2K2 
ON TABLE HOLD AS GENSHOLD FORMAT FOCUS INDEX 
END


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Master
posted Hide Post
Using your original code I wrote the following that dynamically builds master. As a matter of practice, I would avoid using field names like COUNT that are reserved words. I've also included code to build the MACGYVER file if you don't have it. I store the MACGYVER.MAS and MACGYVER.FOC in baseapp.
FILE=MACGYVER,SUFFIX=FOC
SEGNAME=MAC1,SEGTYPE=S1
  FIELD=BLANK  ,     ,A1,INDEX=I,$
SEGNAME=MAC2,SEGTYPE=S1,PARENT=MAC1
  FIELD=COUNTER,ORDER,I4,$

code to build MACGYVER

-DEFAULT &HOWMANY=240;
 CREATE FILE MACGYVER
 MODIFY FILE MACGYVER
 COMPUTE CTR/I9=;
 FIXFORM &HOWMANY(CTR/4 X-4)
 COMPUTE
   BLANK=' ';
   COUNTER=IF COUNTER EQ 0 THEN CTR ELSE COUNTER+1;
 MATCH BLANK
    ON MATCH CONTINUE
    ON NOMATCH INCLUDE
 MATCH COUNTER
    ON MATCH CONTINUE
    ON NOMATCH INCLUDE
 DATA
1
 END
-RUN

Code to build and load GENSHOLD

DEFINE FILE MACGYVER
  TRANS_MM/I6YYM=AYM(&YYMM,COUNTER,'I6YYM');
  COUNT/I5=1;
  PLT_ITEM/I5=99+COUNTER;
END
-*
TABLE FILE MACGYVER
  SUM COUNT
   BY PLT_ITEM 
ACROSS TRANS_MM 
WHERE COUNTER LE 12
   ON TABLE HOLD
END
-*
DEFINE FILE MACGYVER CLEAR
END
-*
TABLEF FILE HOLD
   SUM *
    BY PLT_ITEM NOPRINT
    ON TABLE HOLD AS GENSHOLD FORMAT FOCUS INDEX PLT_ITEM
END
-*
DEFINE FILE MACGYVER
  TRANS_MM/I6YYM=AYM(&YYMM,COUNTER,'I6YYM');
  COUNT/I5=0+COUNTER;
  PLT_ITEM/I5=99+COUNTER;
END
-*
TABLE FILE MACGYVER
  SUM COUNT
   BY PLT_ITEM 
ACROSS TRANS_MM 
 WHERE COUNTER LE 12
    ON TABLE HOLD
END
-*
MODIFY FILE GENSHOLD 
FIXFORM FROM HOLD
MATCH PLT_ITEM
ON NOMATCH INCLUDE
ON MATCH UPDATE *
DATA ON HOLD
END
-RUN


Hope this helps


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Silver Member
posted Hide Post
Thanks a lot,

Actually the genshold file is joined with another hold file and then it is printed.

i am attaching the whole code of both programs.

GIMME18 is the base program and GIMMDAT is the subroutine

-***********************************************************************
-* 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


-*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 **********

END
TABLE FILE GENSHIST
SUM COUNT
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 the code GIMME18 for all plants which have data from last 12 months i dont have any problem. But for plants which have only data from last 6 months i am not able to run the program successfully. i am getting error as fieldname genshold.e07 not recognized. please assist where exactly i need to make changes. and what changes i have to make.

Thanks a lot again for all your responses.


Thanks

focus on mainframe client
Windows
Excel
 
Posts: 33 | Registered: December 14, 2007Report This Post
Master
posted Hide Post
-*-----------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 **********
-*    A D D    T H I S >>>>>>>>>>>>>>>>>>
-* 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 
-* COUNT  <<<<<<<CHANGE THIS TO: 
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  <<<<<<<< REMOVE THIS
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


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Virtuoso
posted Hide Post
Firoz,

Next time you have a question - you need to put it in the Focus/WebFocus Discussion Group. This catagory is for Basic Rules of the Forums.
In the other catagory you will get lot more responses...though..PBrightwell seems to be doing a great job of helping you out.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Silver Member
posted Hide Post
I am extremely sorry, This is my first post in Focal point and it was mistakenly posted here.

Thanks for all your support.


Thanks

focus on mainframe client
Windows
Excel
 
Posts: 33 | Registered: December 14, 2007Report This Post
Silver Member
posted Hide Post
When i made the changes as above and run i am getting the below error

ERROR AT OR NEAR LINE 47 IN PROCEDURE GIMMDATFOCEXEC
(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: I2

The same error is repeated for the next 11 lines also.

Please advise.


Thanks

focus on mainframe client
Windows
Excel
 
Posts: 33 | Registered: December 14, 2007Report This Post
Silver Member
posted Hide Post
The above is resolved be correcting the spelling of Genshold file. Which was misspelled by me. Now after this im getting the same old error as:

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
 
Posts: 33 | Registered: December 14, 2007Report This Post
Master
posted Hide Post
Let's see your new code


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Silver Member
posted Hide Post
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
 
Posts: 33 | Registered: December 14, 2007Report This Post
Master
posted Hide Post
I don't see a FILEDEF for GENSHOLD in GIMMDAT.
Are you running this with JCL? If so, do you have a DD for HOLDMAST? And a DD for GENSHOLD? Do you have an old master for GENSHOLD that only goes thru E06? Are you running GIMMDAT first to recreate your GENSHOLD file?

Try running just the GIMMDAT portion and put ?FF GENSHOLD after your that step. If it is showing more than E06 as the Alias then you are either picking up an old file or an old master in GIMME18. Does this program work for the plants that have been in operation for more than a year?


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Silver Member
posted Hide Post
Pat,

I am not running this using JCL. I am running this online.

When i give ?ff genshold it will show only till e06 when i run for plants which have data from last 6 months only. And for other plants which have data for more than a year will list till e13, and there is no problem either in printing the report. It works well for these plants.

I dont think we require a mast file for genshold as it is dynamically created when the program is run.

Please assist.


Thanks

focus on mainframe client
Windows
Excel
 
Posts: 33 | Registered: December 14, 2007Report This Post
Master
posted Hide Post
I can't see anything else wrong with your program code, but the fact that you are only getting thru E06 tells me that you are picking up an old master or running the original version of the program. Did you make the changes to GIMMDAT in a development library? Does GIMME18 exist in the save library? Try changing your EX GIMMDAT to a -INCLUDE GIMMDAT. Make sure they are both in the same library. At this point I think the problem is not with your program but with your path. If putting them in the same library and doing a -INCLUDE doesn't work, open a case with IBI and have them walk you through how to check your path.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Silver Member
posted Hide Post
Hi Pat,

Yes, I have made the changes in the development library. Yes, GIMME18 exist in the save library.

I ran with -INCLUDE GIMMDAT also but for both i am getting the same following error.

BUILDING TRANSACTION COUNT INFORMATION.
THIS PHASE MAY BE LONG RUNNING... PLEASE WAIT...
ERROR AT OR NEAR LINE 47 IN PROCEDURE GIMMDAT1FOCEXEC
(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: I2
ERROR AT OR NEAR LINE 48 IN PROCEDURE GIMMDAT1FOCEXEC
(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: I2
ERROR AT OR NEAR LINE 49 IN PROCEDURE GIMMDAT1FOCEXEC
(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: I2
ERROR AT OR NEAR LINE 50 IN PROCEDURE GIMMDAT1FOCEXEC
(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: I2
ERROR AT OR NEAR LINE 51 IN PROCEDURE GIMMDAT1FOCEXEC
(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: I2
ERROR AT OR NEAR LINE 52 IN PROCEDURE GIMMDAT1FOCEXEC
(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: I2
ERROR AT OR NEAR LINE 53 IN PROCEDURE GIMMDAT1FOCEXEC
(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: I2
ERROR AT OR NEAR LINE 54 IN PROCEDURE GIMMDAT1FOCEXEC
(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: I2
ERROR AT OR NEAR LINE 55 IN PROCEDURE GIMMDAT1FOCEXEC
(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: I2
ERROR AT OR NEAR LINE 56 IN PROCEDURE GIMMDAT1FOCEXEC
(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: I2
ERROR AT OR NEAR LINE 58 IN PROCEDURE GIMMDAT1FOCEXEC
(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: I2
ERROR AT OR NEAR LINE 60 IN PROCEDURE GIMMDAT1FOCEXEC
(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: I2
ERROR AT OR NEAR LINE 66 IN PROCEDURE GIMMDAT1FOCEXEC
(FOC003) THE FIELDNAME IS NOT RECOGNIZED: TRAN_MM1
BYPASSING TO END OF COMMAND
(FOC009) INCOMPLETE REQUEST STATEMENT


Thanks

focus on mainframe client
Windows
Excel
 
Posts: 33 | Registered: December 14, 2007Report This Post
Master
posted Hide Post
quote:
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;
-*

I didn't catch this before, look at the ifs in your define. Remove all of the /I2 from IF TRANS_MM/I2


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Silver Member
posted Hide Post
Pat, That resolved the error. Now I am able to print all fields but for the fields TRAN_MM1 thru TRAN_MM12. That data is Zero for all plants. Where as in the database the data is non zero.

Please assist.


Thanks

focus on mainframe client
Windows
Excel
 
Posts: 33 | Registered: December 14, 2007Report This Post
Platinum Member
posted Hide Post
I hope PAT is not sending his bills to you Big Grin


WF Server: 7.1.4 on Z/OS and Linux, ReportCaster
Data: DB2, DB2/UDB, Adabas, SQL Server, Oracle Output: HTML,PDF,Excel2K
WF Client: Servlet, CGI
 
Posts: 133 | Registered: May 12, 2007Report This Post
  Powered by Social Strata Page 1 2  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders