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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] DELETE lines in master file

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] DELETE lines in master file
 Login/Join
 
Member
posted
Hi,
is it possible to delete lines from master file.
i have successfully got to a point where my text matches and next i want to delete few lines after my matched text and write with a new data.

Can anyone help me how can i do that

so far i am able to write into the file, but i am able to write at the end of the file not after the text is matched

-SET &MAS_COUNT = &LINES;
-REPEAT :MAS_READ FOR &I FROM 1 TO &MAS_COUNT;
-READ mymaster &Text.&I.A22
-IF &Text.&I EQ 'sometext' THEN GOTO Printit ELSE GOTO REPEAT;
-Printit
-WRITE mymaster "sid"
-EXIT
-:MAS_READ

This message has been edited. Last edited by: <Kathryn Henning>,


WEBFOCUS 8.0
 
Posts: 21 | Registered: July 08, 2015Report This Post
Master
posted Hide Post
Please rephrase the question.


If you want to write to and read from an external file, you need a filedef for this file.

Focal point has numerous examples of this.


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Member
posted Hide Post
quote:
to write to and read from an external file, you need a filedef for this fi


I have used file def

FILEDEF mymaster DISK c:/master.mas (APPEND
-RUN
-SET &MAS_COUNT = &LINES;
-REPEAT :MAS_READ FOR &I FROM 1 TO &MAS_COUNT;
-READ mymaster &Text.&I.A22
-IF &Text.&I EQ 'sometext' THEN GOTO Printit ELSE GOTO REPEAT;
-Printit
-WRITE mymaster "sid"
-EXIT
-:MAS_READ

i am able to write at the end of the file, but i want to write at a particular line


WEBFOCUS 8.0
 
Posts: 21 | Registered: July 08, 2015Report This Post
Expert
posted Hide Post
What are you trying to do with this Master?


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
when ever i update my database table, like adding new field to it, it does not reflect into my master so i am writing a procedure to insert the field names and alias so that it will reflect the changes.


WEBFOCUS 8.0
 
Posts: 21 | Registered: July 08, 2015Report This Post
Expert
posted Hide Post
That is not a good way of updating your Master.

You should use the Reporting Server Console to refresh the master and access files (also called 'metadata' and 'synonym').

You can also use Developer Studio to do this - navigate to the Data Servers area of the Explorer Tree, open the Reporting Server icon, open the list of Applications, open the folder that contains the Master, right-click on the Master and select "Refresh Synonym". This is probably also possible from App Studio.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Master
posted Hide Post
Siddu,

It sounds like you are doing a lot of work for something where you could just edit the masterfile in the text editor, or use the refresh synonym option that Francis describes. Either way, the only reason I could ever see doing something like what you have been talking about would be for mass updates. In that case I would rather do it in Unix using find/replace commands or use a text replace program. No need to invent a big process for things that already exist.


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
 
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 2013Report This Post
Expert
posted Hide Post
You can refresh WebFOCUS metadata for dbms tables with a command like this:

REFRESH SYNONYM app_folder/table_name


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
You can refresh metadata in bulk with code like this:

SET HOLDFORMAT = ALPHA
-RUN

TABLE FILE SYSCAT_TABLES
PRINT
TABSCHEMA
TABNAME
WHERE TABSCHEMA IN ('SCHEMA1', 'SCHEMA2');
ON TABLE HOLD AS HOLD01
END
-RUN
-SET &NBR_TABLES = &LINES;

-REPEAT END_REP001 &NBR_TABLES TIMES

-READ HOLD01 NOCLOSE &TABSCHEMA.A128. &TABNAME.A128.

-SET &TAB_NAME = &TABSCHEMA || '.' || &TABNAME;
-SET &SYN_NAME = &TABSCHEMA || '_' || &TABNAME;

DROP SYNONYM app_folder/&SYN_NAME
END
-RUN

-*CREATE SYNONYM [app name]/[new synonym] FOR [target table] DBMS [dbms type i.e. SQLMSS,DB2] AT [adapter name]

CREATE SYNONYM app_folder/&SYN_NAME FOR &TAB_NAME DBMS DB2
END
-RUN

-END_REP001


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
What I have found with REFRESH is that it does not refresh the formats of the fields.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Member
posted Hide Post
Thanks Francis it worked


WEBFOCUS 8.0
 
Posts: 21 | Registered: July 08, 2015Report 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] DELETE lines in master file

Copyright © 1996-2020 Information Builders