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. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] dynamic master description

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] dynamic master description
 Login/Join
 
Gold member
posted
hi,

I would like to update an existing master file with fex.
I want to browse app path directory , open every master file, and write on each line of each master a news TITLE tag.
It's for Oracle master files.

Example :

Original Master :

Master ABCD.MAS
FILENAME=ABCD, SUFFIX=SQLORA , $
SEGMENT=ABCD, SEGTYPE=S0, $
FIELDNAME=CHAMP1, ALIAS=CHAMP1, USAGE=A26V, ACTUAL=A26V, MISSING=ON, $
FIELDNAME=CHAMP2, ALIAS=CHAMP2, USAGE=A15V, ACTUAL=A15V,
MISSING=ON, $

target Master (with the same name, overwrite existing master)
Master ABCD.MAS
FILENAME=ABCD, SUFFIX=SQLORA , $
SEGMENT=ABCD, SEGTYPE=S0, $
FIELDNAME=CHAMP1, ALIAS=CHAMP1, USAGE=A26V, ACTUAL=A26V,TITLE='DESC 1', MISSING=ON, $
FIELDNAME=CHAMP2, ALIAS=CHAMP2, USAGE=A15V, ACTUAL=A15V,TITLE='DESC 2',
MISSING=ON, $

Any idea how to do this ?

This message has been edited. Last edited by: FP Mod Chuck,


Webfocus 8.201M.
Windows
InfoAssist +
Chrome, IE, Excel, HTML; PDF, AHTML,GRAPH
 
Posts: 92 | Location: France | Registered: July 08, 2009Report This Post
Virtuoso
posted Hide Post
You can get the app directories and their files using APP QUERY and friends. That also allows filtering on certain extensions. Searching these forums should turn up some examples.

Next, you can go through each file using -REPEAT and -READ to read each line into an amper-variable. There should be enough examples of that as well.

Finally, you alter the contents of that variable if it contains FIELDNAME and not TITLE.

The difficult bits are determining which master files qualify (ie. they need an equaly named access file that references the appropriate CONNECTION) and determining what the contents of the added TITLE field should be.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Gold member
posted Hide Post
Thanks for your answer Wep5622

Ok for -READ but how can i update overwrite file ?
with MODIFY command ?


Webfocus 8.201M.
Windows
InfoAssist +
Chrome, IE, Excel, HTML; PDF, AHTML,GRAPH
 
Posts: 92 | Location: France | Registered: July 08, 2009Report This Post
Virtuoso
posted Hide Post
Hi Jacquetl

I wrote a application that does just what you are looking for. The customer was using SQL Server and wanted the TITLE and DESCRIPTION to be the real field name from SQL Server but you can fix that part of the code to be whatever you want. I am going to to e-mail you the application.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
 
Posts: 2128 | Location: Customer Support | Registered: April 12, 2005Report This Post
Platinum Member
posted Hide Post
For something like this I'd recommend using APP COPYF to copy your MFDs to a temp folder. You could then use -READ and -WRITE in a loop to overwrite your original MFD.
 
Posts: 164 | Registered: March 26, 2003Report This Post
Gold member
posted Hide Post
Oh great chuck wolff, e-mail me the application .
I w'ill test it

Thanks


Webfocus 8.201M.
Windows
InfoAssist +
Chrome, IE, Excel, HTML; PDF, AHTML,GRAPH
 
Posts: 92 | Location: France | Registered: July 08, 2009Report This Post
Gold member
posted Hide Post
Can I get a copy of this application please, I'm dealing with the same issue.


version 8202M
Reporting Server on
Windows Server using DB2 Connect to access data from iseries.
 
Posts: 78 | Registered: December 29, 2009Report This Post
Virtuoso
posted Hide Post
Joe

This app works fine with version 8.1.05 but I tried it with 8.2.06 and it no longer works. I will try to debug it and let you know.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
 
Posts: 2128 | Location: Customer Support | Registered: April 12, 2005Report This Post
Virtuoso
posted Hide Post
This might do the trick:
  
-SET &ECHO=ALL;
-* File jacquetl.fex
FILEDEF ABCD DISK ABCD.MAS
FILEDEF NEWMAS DISK NEWMAS.MAS (APPEND
SET HOLDLIST=PRINTONLY
-RUN
-WRITE ABCD FILENAME=ABCD, SUFFIX=SQLORA , $
-WRITE ABCD SEGMENT=ABCD, SEGTYPE=S0, $
-WRITE ABCD FIELDNAME=CHAMP1, ALIAS=CHAMP1, USAGE=A26V, ACTUAL=A26V, MISSING=ON, $
-WRITE ABCD FIELDNAME=CHAMP2, ALIAS=CHAMP2, USAGE=A15V, ACTUAL=A15V, MISSING=ON, $
-RUN
!TYPE ABCD.MAS
-RUN
TABLE FILE SYSCOLUM
IF TBNAME EQ ABCD
PRINT
COMPUTE L1/A640='FILENAME=' || TBNAME || ', SUFFIX=' || TBTYPE;
ON TABLE HOLD AS NEWMAS FORMAT ALPHA
END
-RUN
TABLE FILE SYSCOLUM
IF TBNAME EQ ABCD
PRINT
COMPUTE L1/A640='SEGNAME=' || SEGNAME || ', SEGTYPE=S0' ;
ON TABLE SAVE AS NEWMAS
END
-*-GOTO A
-RUN
DEFINE FILE SYSCOLUM
TTL/A40=DECODE NAME('CHAMP1' 'DESC 1' 'CHAMP2' 'DESC 2' ELSE 'OTHER');
MISSING/A3=IF NULLABLE EQ 1 THEN 'ON' ELSE 'OFF';
END
-RUN
TABLE FILE SYSCOLUM
IF TBNAME EQ ABCD
PRINT
COMPUTE L1/A1200='FIELDNAME=' || NAME || ', ALIAS=' || ALIAS || ', USAGE=' || USAGE || ', ACTUAL=' || ACTUAL ||
                ', TITLE=''' || TTL || ''', MISSING=' || MISSING  || ', $';

ON TABLE SAVE AS NEWMAS
END
-RUN
-A
!TYPE NEWMAS.MAS


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Virtuoso
posted Hide Post
I was able to get my app working with 8.2.06 and sent it to Joe but Joe you should consider Daniel's option as well.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
 
Posts: 2128 | Location: Customer Support | Registered: April 12, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] dynamic master description

Copyright © 1996-2020 Information Builders