Focal Point
[SOLVED] load FML hierarchy into hold file

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5697019995

March 08, 2011, 07:22 PM
Swamp
[SOLVED] load FML hierarchy into hold file
I am trying to load a FML hierarchy into a hold file because I need to do some COMPUTEs on the PARENT and CHILD fields. When I try to display the file I get error "(FOC36364) REQUESTED HIERARCHY IS NOT LOADED". It is as though the file is not created with the PROPERTY=PARENT_OF and REFERENCE=MY_ACCOUNT attributes. Also, I can print the fields of the file with ?FF but that does not show if I have those attributes defined. Does anybody have any ideas so to what I am doing wrong?

Thanks,
Swamp

The code follows:

-****************************************
-* Create hierarchy file with PARENT_OF *
-****************************************
FILEDEF CENTGLM DISK CENTGLF.MAS
FILEDEF CENTGLF DISK CENTGLF.FTM
-RUN
-WRITE CENTGLM FILE=CENTGLF,SUFFIX=FIX
-WRITE CENTGLM SEGNAME=CENTGLF ,SEGTYPE=S01
-WRITE CENTGLM FIELDNAME=MY_ACCOUNT_PARENT,USAGE=A7,ACTUAL=A7,PROPERTY=PARENT_OF,REFERENCE=MY_ACCOUNT,$
-WRITE CENTGLM FIELDNAME=MY_ACCOUNT,USAGE=A7,ACTUAL=A7,$
-RUN
?FF CENTGLF

-************************************
-* Display input file for debugging *
-************************************
-*TABLE FILE CENTGL
-*PRINT *
-*END

-************************************
-* Create a hold file from computes *
-************************************
TABLE FILE CENTGL
PRINT
COMPUTE MY_ACCOUNT/A7 = GL_ACCOUNT;
COMPUTE MY_ACCOUNT_PARENT/A7 = GL_ACCOUNT_PARENT;
ON TABLE HOLD AS CENTGLF
END

-************************************
-* Display hierarchy *
-************************************
TABLE FILE CENTGLF
PRINT GL_ACCOUNT_PARENT
FOR GL_ACCOUNT
'2600' WITH CHILDREN
END

This message has been edited. Last edited by: Swamp,


WebFOCUS 7.6.10
Windows
Excel, PDF, HTML
March 09, 2011, 11:11 AM
Francis Mariani
1) FML and HOLD files don't go together well.
2) The PROPERTY and REFERENCE properties do not get saved in the HOLD file
3) Reading the manual (Creating Financial Reports > Creating Reports With Financial Report Painter > Reporting Dynamically From a Hierarchy), it appears you would have to code these properties, which means you could create your own Master and use it instead of the one created by the HOLD command.

You would have to do something like this:

FILEDEF CENTGLF DISK CENTGLF.FTM

TABLE FILE CENTGL
...
ON TABLE HOLD AS CENTGLF
END

FILEDEF CENTGLFF DISK CENTGLF.FTM

TABLE FILE CENTGLFF
...
'2600' WITH CHILDREN
END




Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
March 09, 2011, 06:59 PM
Swamp
Francis,

Thanks. I believe you have led me right to the solution. I will post tomorrow with a cleaned up example.

Thanks,
Swamp


WebFOCUS 7.6.10
Windows
Excel, PDF, HTML
March 16, 2011, 04:31 PM
Swamp
Francis,

Here is my cleaned up example. I did exactly as you said creating my own Master to re-create the PROPERTY and REFERENCE properties that are lost when you create a HOLD file. I did have to add some FILLER fields to make things work.



-************************************
-* Display input file for debugging *
-************************************
-*TABLE FILE CENTGL
-*PRINT *
-*END

-************************************
-* Create a hold file from computes *
-************************************
TABLE FILE CENTGL
PRINT *
COMPUTE MY_ACCOUNT/A7 = GL_ACCOUNT;
COMPUTE MY_ACCOUNT_PARENT/A7 = GL_ACCOUNT_PARENT;
COMPUTE MY_ACCOUNT2/A7 = GL_ACCOUNT;
COMPUTE MY_ACCOUNT_PARENT2/A7 = GL_ACCOUNT_PARENT;
COMPUTE MY_ACCOUNT3/A7 = GL_ACCOUNT;
ON TABLE HOLD AS CENTGLF
END
-RUN

? HOLD CENTGLF

-************************************
-* Display HOLD file for debugging *
-************************************
-*TABLE FILE CENTGLF
-*PRINT *
-*END

-******************************************************************************
-* Create a NEW .mas file to insert PROPERTY and REFERENCE for hierarchy *
-* N.B. By trial-and-error I discovered that I needed to add FILLER fields. *
-******************************************************************************
FILEDEF CENTGLM DISK CENTGLF.MAS
-RUN
-WRITE CENTGLM FILE=CENTGLF,SUFFIX=FIX
-WRITE CENTGLM SEGNAME=CENTGLF ,SEGTYPE=S01
-WRITE CENTGLM FIELDNAME=GL_ACCOUNT, USAGE=A7,ACTUAL=A7,$
-WRITE CENTGLM FIELDNAME=GL_ACCOUNT_PARENT, USAGE=A7,ACTUAL=A7,$
-WRITE CENTGLM FIELDNAME=GL_ACCOUNT_TYPE, USAGE=A1,ACTUAL=A1,$
-WRITE CENTGLM FIELDNAME=GL_ROLLUP_OP, USAGE=A1,ACTUAL=A1,$
-WRITE CENTGLM FIELDNAME=GL_ACCOUNT_LEVEL, USAGE=I3,ACTUAL=I3,$
-WRITE CENTGLM FIELDNAME=GL_ACCOUNT_CAPTION, USAGE=A30,ACTUAL=A30,$
-WRITE CENTGLM FIELDNAME=SYS_ACCOUNT, USAGE=A6,ACTUAL=A6,$
-WRITE CENTGLM FIELDNAME=FILLER, USAGE=A13,ACTUAL=A13,$
-WRITE CENTGLM FIELDNAME=MY_ACCOUNT, USAGE=A7,ACTUAL=A7,$
-WRITE CENTGLM FIELDNAME=FILLER1, USAGE=A1,ACTUAL=A1,$
-WRITE CENTGLM FIELDNAME=MY_ACCOUNT_PARENT, USAGE=A7,ACTUAL=A7,PROPERTY=PARENT_OF,REFERENCE=MY_ACCOUNT,$
-WRITE CENTGLM FIELDNAME=FILLER2, USAGE=A1,ACTUAL=A1,$
-WRITE CENTGLM FIELDNAME=MY_ACCOUNT2, USAGE=A7,ACTUAL=A7,$
-WRITE CENTGLM FIELDNAME=FILLER3, USAGE=A1,ACTUAL=A1,$
-WRITE CENTGLM FIELDNAME=MY_ACCOUNT_PARENT2, USAGE=A7,ACTUAL=A7,$
-WRITE CENTGLM FIELDNAME=FILLER4, USAGE=A1,ACTUAL=A1,$
-WRITE CENTGLM FIELDNAME=MY_ACCOUNT3, USAGE=A7,ACTUAL=A7,$

-RUN
? HOLD CENTGLF

-*FILEDEF CENTGLFF DISK CENTGLF.FTM

-************************************
-* Display HOLD file for debugging *
-************************************
-*TABLE FILE CENTGLF
-*PRINT *
-*END

-************************************
-* Display hierarchy *
-************************************
TABLE FILE CENTGLF
PRINT MY_ACCOUNT
MY_ACCOUNT_PARENT
MY_ACCOUNT2
MY_ACCOUNT_PARENT2
MY_ACCOUNT3
GL_ACCOUNT
GL_ACCOUNT_PARENT
FOR MY_ACCOUNT
'2500' WITH CHILDREN
END

-************************************
-* Display hierarchy *
-************************************
TABLE FILE CENTGL
PRINT GL_ACCOUNT_PARENT
GL_ACCOUNT
FOR GL_ACCOUNT
'2600' WITH CHILDREN
END

This message has been edited. Last edited by: Swamp,


WebFOCUS 7.6.10
Windows
Excel, PDF, HTML
March 29, 2011, 03:03 PM
Swamp
As a follow-up to my previous post, I have learned a few things. It is easier to have the file be a FOCUS file so I would make the following change:

-WRITE CENTGLM FILE=CENTGLF,SUFFIX=FIX
-WRITE CENTGLM SEGNAME=SEG01 ,SEGTYPE=S1

This will involve changing your filler fields.

Also, I am told that it is best if the hierarchy field is indexed:

-WRITE CENTGLM FIELDNAME=MY_ACCOUNT, USAGE=A7,ACTUAL=A7,FIELDTYPE=I,$


And, as you know the Hierarchy field and parent field need to have the same definition (A7, in this case) but the caption field can be different (A30).


WebFOCUS 7.6.10
Windows
Excel, PDF, HTML
March 29, 2011, 03:08 PM
Francis Mariani
Thanks for the update Swamp.

I'll keep your findings close - I have to fiddle about with FML very soon.

Cheers,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server