Ginny,
Since a Hold file is a of focus format, I did the option 1, to put APP PREPENDPATH, but doesnt seem to be working.
Basically if I dont index the GL_TRANS_TEMP hold file, it works fine but dosnt give me correct amounts.
cmallain,
The comment isnt there is in the report, I have added it for better understading,.....so thats not an issue.
FrankDutch,
I have put ASNAMES and still not working.
Linus,
tried your option too.....but bad luck for me
Pat,
I renamed all the fields and here is my new code now,
JOIN
LEFT_OUTER F_GL_TRANS.MSTR_ACCT_KEY IN F_GL_TRANS TO UNIQUE
MSTR_CHART_OF_ACCTS.MASTER_ACCT_KEY IN MSTR_CHART_OF_ACCTS AS J4
END
JOIN
LEFT_OUTER F_GL_TRANS.BUS_UNIT_KEY IN F_GL_TRANS TO UNIQUE
BUS_UNIT.BUS_UNIT_KEY IN BUS_UNIT AS J5
END
JOIN
LEFT_OUTER F_GL_TRANS.LEDGER_TYPE_KEY IN F_GL_TRANS TO UNIQUE
LEDGER_TYPE.LEDGER_TYPE_KEY IN LEDGER_TYPE AS J6
END
JOIN
LEFT_OUTER F_GL_TRANS.GL_TRANS_DETAIL_KEY IN F_GL_TRANS TO UNIQUE
GL_TRANS_DETAILS.GL_TRANS_DETAIL_KEY IN GL_TRANS_DETAILS AS J11
END
JOIN
LEFT_OUTER F_GL_TRANS.BATCH_KEY IN F_GL_TRANS TO UNIQUE
BATCH.BATCH_KEY IN BATCH AS J12
END
JOIN
BUS_UNIT.COMPANY_KEY IN F_GL_TRANS TO UNIQUE
COMPANY.COMPANY_KEY IN COMPANY AS J0
END
-*-------------------
TABLE FILE F_GL_TRANS
PRINT
MSTR_ACCT_KEY AS ACCTKEY
BUS_UNIT_KEY AS UNITKEY
F_GL_TRANS.F_GL_TRANS.AMT
-*
BY MSTR_CHART_OF_ACCTS.OBJECT_ACCT_CD
BY MSTR_CHART_OF_ACCTS.ACCT_DESC
BY BUS_UNIT.BUS_UNIT_ID
BY COMPANY.COMPANY_ID
-*
WHERE FF_GL_TRANS.GL_DATE GE DT(&TRDATE1) AND F_GL_TRANS.GL_DATE LE DT(&TRDATE2);
WHERE COMPANY.COMPANY_ID EQ '&PROPNBR1';
-*
ON TABLE HOLD AS GLTRANS FORMAT FOCUS INDEX ACCTKEY UNITKEY
-*----------
-*************Comment : As per FrankDutch suggestions, reduces trhe size of index fields and also Accodint ************
-*************to Linus suggestiosn changed these index fields to Db field names, but it didnt work either. ************
-*----------
END
-RUN
-*-------
TABLE FILE GLTRANS
BY ACCTKEY
BY UNITKEY
BY OBJECT_ACCT_CD
ON TABLE HOLD AS BU_ACC FORMAT FOCUS INDEX ACCTKEY UNITKEY
END
-RUN
-*-EXIT
-*-------------------
JOIN
LEFT_OUTER BU_ACC.ACCTKEY AND BU_ACC.UNITKEY IN BU_ACC TO MULTIPLE
F_GL_BALANCES.MASTER_ACCT_KEY AND F_GL_BALANCES.BUS_UNIT_KEY IN F_GL_BALANCES AS JX1
END
TABLE FILE BU_ACC
SUM
COMPUTE BEGIN_BAL/D20.2 = IF OBJECT_ACCT_CD LE '399999' THEN
END_OF_PER_BALANCE + PRIOR_YEAR_BALANCE
ELSE END_OF_PER_BALANCE;
BY UNITKEY
BY ACCTKEY
BY OBJECT_ACCT_CD
WHERE END_OF_MONTH_DATE EQ DT(&BALEDDT);
WHERE LEDGER_TYPE_KEY EQ 1;
ON TABLE HOLD AS GLBAL FORMAT FOCUS INDEX ACCTKEY UNITKEY
END
-RUN
-*----------
-************* I also need to join the 2 HOLD files 'GLTRANS'(created first) and GLBAL(created above) ************
-************* both the joining HOLD Files are focus format and indexed by same fields ************
-************* Till I put -EXIT heere, it runs well, so looks like there is a problem in the following join*******
-************* but unbale to get the problem/syntax error.
-*----------
-*---------------------------------
JOIN
INNER GLTRANS.ACCTKEY AND GLTRANS.UNITKEY IN GLTRANS TO
GLBAL.ACCTKEY AND GLBAL.UNITKEY IN GLBAL AS JX2
END
-*------------------------
TABLE FILE GLTRANS
PRINT
COMPANY_ID AS 'CO'
OBJECT_ACCT_CD AS 'Account'
COMPUTE DEBIT/D20.2CM = IF AMT GE 0 THEN AMT ELSE 0;
AS 'Debit'
COMPUTE CREDIT/D20.2CBM = IF AMT LT 0 THEN AMT ELSE 0;
AS 'Credit'
END
BY COMPANY_ID NOPRINT
BY OBJECT_ACCT_CD NOPRINT
Its still giving me en error as
-------------------------------------------------------------------------
(FOC236) LINKED FILE DOES NOT HAVE A MATCHING KEY FIELD OR SEGMENT: GLBAL
BYPASSING TO END OF COMMAND
-------------------------------------------------------------------------