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.
I've been working on a code validator for our release process to try to force coding to standards we have.
The Validator will check for things like: Missing DM Labels Duplicate DM Labels Missing Semocolons on -SET's -EXIT -QUIT &ECHO to ON or ALL -TYPE SQL Tracing READ/RECORDLIMITs
Does anyone have any other ideas on commands that could cause issues and therefore be checked and highlighted ?This message has been edited. Last edited by: FP Mod Chuck,
Multiple -DEFAULT's for the same parameter (especially problematic when using -INCLUDE).
SQL blocks starting with a TAB character (often that just works, but then suddenly it doesn't - not sure what's going on there).
Indented DM code where the - (minus) is not at position 0 in the line.
Indented comments (similar to above, but asterisk can't be indented).
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 :
1) Ensure that all "Test" and "Extraneous" code has been removed.
2) I like to add a -TYPE statement in my flower boxes at the start and end of all fexes for easy fex identification when debugging, such as the following:
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 :
Saw that at a few upgrades from early 7 to 7.7.03 but not seen it since - probably because all the occurences were found upgrading to 7.7.03 and that version objected!
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
I think .EVAL in a DM -SET is almost always wrong. An assignment to a -DEFAULT expression not so much though.
Within FOCUS code it depends a lot on the value of the .EVAL'ed parameter. If it contains '-*' or '', for example, that's a valid usage.
Your example substituting -TYPE or -* using .EVAL is another case that's valid.
I do see things like these from time to time:
ON TABLE HOLD AS &HOLDFILE.EVAL
-INCLUDE &FEX.EVAL
But valid is (in fact, that's a common workaround for "&FEX not found" warnings here):
-SET &FEX = '-INCLUDE fex.fex';
&FEX.EVAL
I think the very nature of .EVAL makes it hard, if not impossible, to detect invalid or valid usage. I think it's okay to issue a warning whenever you encounter .EVAL though.
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 :
quote: Indented comments (similar to above, but asterisk can't be indented).
Shouldn't be an issue?
COMPUTE SOMETHING/A1 = 'X'; -* this comment is syntactically correct from version 8.something
I'm fairly certain this indeed needs to be something to be aware of. One of our team members is in the process of cleaning things up for upgrade to 8.2.02 and one of the objectives he's required to do is ensure all comments are left aligned in the code. We were told by IBI any comments not left aligned or placed in the first two character spaces may cause problems.
JC WebFOCUS Dev Studio / App Studio 8.2.01 Windows 7
Run from the repository: Leading spaces are removed, so the indented comments work. The comment on the end of the -SET works Comments on the end of FOCUS code (DEFINE field) fails.
Run from the reporting server: Leading spaces are NOT removed, so the indented comments 3 to 6 fail. The comment on the end of the -SET works Comments on the end of FOCUS code (DEFINE field) fails.
I recently created a .NET Core 2.0 console app written in C# I called SearchReplace. It takes any file directory and searches through it to locate specific strings in whichever file types you desire (prompts for a pattern), and then replaces them with whatever you want. This was the beginning of what Waz is looking to do (just not in FOCUS...lol), but I've only used it to search CM packages for strings where a specific server was mentioned explicitly within our code somewhere (SQLOUT statements, etc.), and replacing those with a new server name. Then I CM the whole thing back into the environment (UPDATE/REPLACE) and things just work. LOL
There's not much code either:
/*
SearchReplace is a utility app I created to give users the ability to search any directory on their PC
and all that directory's subdirectories for anything they are searching for within the files found therein.
The program will ask the user for the root directory to search in, which files to search in, and which strings
to use to search for and replace with.
Author: Anthony Cool
Created: 10/26/2017
*/
using System;
using System.IO;
namespace SearchReplace
{
class Program
{
static void Main(string[] args)
{
// C:\pathToSearchDirectory\..
string rootDirectory = "";
// Welcome and ask user what folder to search in:
Console.WriteLine("\nWelcome to SearchReplace.\n\n"
+ "What's the full path to the directory to search in?\n");
// Store response:
try {
rootDirectory = @Console.ReadLine();
// If user fails to give a directory/folder, set to something to exit app smoothly:
if(rootDirectory == null || rootDirectory == "") {
rootDirectory = "YOU DID NOT GIVE A DIRECTORY TO SEARCH WITHIN";
}
// Set directory given to current directory to check if valid:
Directory.SetCurrentDirectory(rootDirectory);
}
catch (DirectoryNotFoundException dirEx) {
// Let the user know that the directory did not exist:
Console.WriteLine("The directory does not exist. Details: " + dirEx.Message);
Environment.Exit(0);
}
// Ask user what file pattern to restrict the search to:
Console.WriteLine("\nWhen we search your directory, which file names & types would you like to search in?\n"
+ "This is specified by giving a pattern. * means 0 or more chars, while ? means 0 or 1 chars.\n"
+ "Example: *.* = all names & types, *.fex = all fex files regardless of names, etc.\n");
// Store response:
string searchPattern = @Console.ReadLine();
// Ask user which string to search for:
Console.WriteLine("\nWhat string should be searched for and replaced?\n");
// Store response:
string searchString = @Console.ReadLine();
// Ask user what string should replace the search string:
Console.WriteLine("\nWhat string should replace the string we're searching for?\n");
// Store response:
string replacementString = @Console.ReadLine();
// Gather all the files in the root directory and its subdirectories and store them to be looped through:
var files = Directory.EnumerateFiles(rootDirectory, searchPattern, SearchOption.AllDirectories);
// Loop through every file found above:
foreach (string file in files) {
try {
// If the file contains the string to be replaced:
if(File.ReadAllText(file).Contains(searchString) == true){
// Read the text from the file and store it:
string contents = File.ReadAllText(file);
// Replace search string with replacement string (using .NET Core 2.0+ overload):
contents = contents.Replace(searchString, replacementString, StringComparison.OrdinalIgnoreCase);
// Make file writable if it isn't already:
File.SetAttributes(file, FileAttributes.Normal);
// Overwrite the file with the changes made:
File.WriteAllText(file, contents);
}
else {
// Skip the file and move to the next file:
continue;
}
}
catch (Exception ex) {
Console.WriteLine("Sorry. The following error has occurred:\n\n" + ex.Message);
}
}
// State that the text replacements have been made:
Console.WriteLine("\nThank you for your patience.\n\n"
+ "\"" + searchString + "\"" + " has been fully replaced with " + "\"" + replacementString + "\".");
// Pause the program before exiting so the end user can read the above message beforehand:
Console.ReadLine();
}
}
}
Have fun!! (feel free to use it)This message has been edited. Last edited by: CoolGuy,
8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
Posts: 1113 | Location: USA | Registered: January 27, 2015