Focal Point
Tables Manipulation

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

January 17, 2008, 09:24 AM
L_G
Tables Manipulation
Hi All,

Sorry about the question but I am new in the Developer Studio...

Do you now how I can manipulate the tables (mas files)? I need to iterate through the tables data, to create new tables and so on...

Currently I am reading the Maintain documentation but I still do not know whether it will help me.

Can somebody help me?

Thanks in advance!


WebFOCUS 7.6
Windows 2000
Output: HTML, PDF
January 17, 2008, 09:37 AM
FrankDutch
L_G

I would suggest to find your nearest IBI office and book a starter course.

"Manipulate" master files ? Why?

Just start with some basic reports on the CAR database.
You ask something on Developer Studio and you read the Maintain manual. It's like starting Excel on your PC and read the helpfile for Powerpoint.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

January 17, 2008, 10:06 AM
L_G
Thanks for the answer FrankDutch

I have created a simple report that joins two tables(synonyms) and print some fields.

I need to find a flexible way to cultivate the tables (synonyms) data.



For example if you have the following tables:

EMPLOYEE
----------------
id
names
salary
type_id

EMPLOYEE_TYPE
----------------
id
type
description


I want to create another table(synonyms) that will be used as output for the report:

RESULT
--------------
employee_name
employee_type
salary
(and some other column that is not related to the EMPLOYEE and TYPE tables)


I know that I can join the tables and to use some Temporary field to create this report but I want to bring out the logic...

I hope the information above is not confused...


WebFOCUS 7.6
Windows 2000
Output: HTML, PDF
January 17, 2008, 10:19 AM
GinnyJakes
I'm sorry but it is confusing. If you've already done the join and the table, you can hold the data and join it to something else.

JOIN ID IN EMPLOYEE TO ALL ID IN EMPLOYEE_TYPE AS J1
TABLE FILE EMPLOYEE
PRINT SALARY
... Don't know where your other columns are coming from but you might need another join.
BY EMPLOYEE_NAME
BY EMPLOYEE_TYPE
END  

Please clarify your requirements.

Frank is correct. You need to read the "Developing Reports with the WebFOCUS Language" manual, not the MAINTAIN manual.

There used to be a FOCUS Primer book years ago. I wonder if it is still available.... It was a great tool to show off the basics of the language.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
January 17, 2008, 10:39 AM
L_G
That is what I am trying to say, this additional column should be added by some external code.


I need to migrate reports from AS (it is old reporting system) to WebFocus. This AS reports used very strange logic. They convert many tables into one table, adds columns, deletes columns and so on. I need to observe this logic.

Could you tell me please, what Maintain is used for?

Thanks


WebFOCUS 7.6
Windows 2000
Output: HTML, PDF
January 17, 2008, 10:47 AM
FrankDutch
Maintain is used for updating your database by user input.
You can build screens that ask for data and behind the screen you can do calculations before they are send to the database. (that's just one function)




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

January 17, 2008, 10:58 AM
L_G
Thanks for your help.

Do you know whether it is possible to manipulate the data in another way?


WebFOCUS 7.6
Windows 2000
Output: HTML, PDF
January 17, 2008, 11:44 AM
GinnyJakes
quote:
They convert many tables into one table, adds columns, deletes columns and so on. I need to observe this logic.

You can do all of this with DEFINE, COMPUTE, and HOLD files.

If you give us more detail, we might be better able to help.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
January 17, 2008, 12:04 PM
L_G
I will try to describe the Life-cycle of AS reports.

First AS joins 2 tables (EMPLOYEES and EMPLOYEE_TYPE) AND the output of those tables is stored to another table. After that AS make some calculations and adds new row to the output table. After the row is added it renames the table's columns. When this transformation is completed the AS use the output table to Print report


WebFOCUS 7.6
Windows 2000
Output: HTML, PDF
January 17, 2008, 12:14 PM
GinnyJakes
This all sounds doable. Can you describe more fully what the additional calculations are and where the data for those calculations come from?

In WF, you can create what is called a HOLD file from the output of the join, then append data to that file, and then do another report where you use the phrase PRINT FIELDNAME AS 'XXXX' to rename the columns.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google