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'm new to WebFOCUS, and I could use a utility to map out TABLE FILE requests, with DEFINEs, JOINs, etc, so I can see how the data flows through a procedure.
I also want to search through all the files in an app directory.
I am working on something to help me do this, but do not want to "re-invent the wheel" so to speak.
Is there already something out there, or should I continue working on mine ?
Is there a need for something like this ?
Thanks in advance for your response !This message has been edited. Last edited by: Kerry,
We are working on the second for a while since we have maybe the same requirements . What we do now is running a proces that starts with a DIR command on the DOS level, we pipe the output to a file and that file is the source for our internal administration. What we would like to have, is the possibility to read in the fex and use the documentation.
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
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006
I agree with Frank regarding question 2 and I do lots and lots of that. I have a generic master called LINE80 to which I filedef the results of the directory listing command. I parse the heck of the results and create reports for any number of reasons.
As for question 1, that is more like a FOCUS internals class. Since the FOCUS language is interpretive, data doesn't actually 'flow' but there are operations that are performed in a certain order. For instance, with or without a join:
1. Read the record. 2. Apply screening conditions against 'real' fields, i.e. those in the master. 3. Perform any defines. 4. Apply screening conditions against defined fields. 5. Build the internal matrix. 6. Process any COMPUTEs on the internal matrix. 7. Calculate any requested totals. 8. Present the report.
I'm sure that I have forgotten a thing or two but those are the 8 commandments I live by when deciding how to architect a program.
Just create a generic MFD (like Ginny uses) and FILEDEF the program itself - in other words you would write a program about what programs contain, EXECute, -INCLUDE, DEFINE, etc.
Since FEXs are just text, you could probably write a Perl script that would be much more robust and could do everything you're looking for but that may be beyond some people - might be a cool weekend project though...
WebFOCUS 7.6.6/TomCat/Win2003,SQL Server 2005,Oracle
Posts: 125 | Location: New England | Registered: February 20, 2007
Thanks RickW and GinnyJakes - Being text files they can be more processed easily. Since I was working on importing from SQL in MS Access, I wrote a routine that searches every program in an application directory and produces a text file with the filename and the line # where the search string was found, plus the complete line that was found
I'm working on a version that searches for WF-specific keywords, such as TABLE FILE, DEFINE, JOIN, etc, to produce a 'Data Flow' report for each file.
Both the 'Map' and 'Search' functions will recursively search all -INCLUDE files as well.
If you enter an empty string to search, the program will find "nothing," and simply return all of the files in a single composite document with code lines numbered (including INCLUDEd code, separately numbered)
(NOTE : The funky filenames were not my design !)
"Stop me if you've heard this one before !" This message has been edited. Last edited by: Charlz,
In fact a recent bulk update to all of our reports has been made exceedingly simple with tools like notepad++, winmerge and replacem which we used to identify and carry out our updates - i think it's a real strength of the code
as you say gives you all manner of options and methods...
Developer Studio 7.64 Win XP Output: mostly HTML, also Excel and PDF
"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor
Posts: 285 | Location: UK | Registered: October 26, 2007
It doesn't map the flow, but it does scan fex's and report on -INCLUDE's, Masters and Set Commands. It also report of a range of possible issues, such as missing DM labels and possible test remenants.
We use it as a check mechanism before deployment to the Test environments.
This code will list a load a focus db with every code line of every .fex found in the folder mentioned in &DIR2LIST. It make use of the APP query command. You can do the same kind of thing for all you master files using the CHECK FILE <master> HOLD get a hold file containing the details of the master file
Once you have these Data bases it is a simple thing to create reports parse the text line with the GETTOK, POSIT and SUBSTRING functions.
PRINT FILENAME COMPUTE PAD/A64 = ' '; WHERE FILENAME CONTAINS '.fex' OR FILENAME CONTAINS '.FEX' ON TABLE HOLD AS FILELIST FORMAT ALPHA END -RUN -GETLOOP -READ FILELIST NOCLOSE &FILEIN.A40. -IF &IORETURN NE 0 THEN GOTO ENDLOOP; -SET &FILESPEC = &DIR2LIST || '\' || &FILEIN; FILEDEF FEXIN DISK &FILESPEC -RUN TABLE FILE FEXIN PRINT COMPUTE FILENAME/A80 = &FILEIN.QUOTEDSTRING; COMPUTE LINE/I8 = LAST LINE + 1; TEXT ON TABLE HOLD AS HOLDFEX FORMAT ALPHA END -RUN MODIFY FILE CODE_DB FIXFORM FROM HOLDFEX MATCH FILENAME ON MATCH CONTINUE ON NOMATCH INCLUDE MATCH LINE ON MATCH UPDATE TEXT ON NOMATCH INCLUDE DATA ON HOLDFEX END -RUN -GOTO GETLOOP -ENDLOOP TABLE FILE CODE_DB SUM TEXT BY FILENAME BY LINE END -RUN
</code>
Jim Morrow Web Focus 7.6.10 under Windows 2003 MVS 7.3.3
This is pretty slick coding. I tried it on our database, but it is cutting off the first 2 character in the text. the FILENAME and COMPUTE LINE/I8 = LAST LINE + 1 is working fine but in the TEXT is cut the data off. can you give me an educated guess on why this is happening, I have tried everything I can think of with no luck
Thanks Chuck
Prod: WebFOCUS 7.1, 7.13, 7.6 Test: DevStudio 7.1, 7.6 Servlet - Self Service - MS Windows XP SP2 - Apache Tomcat 5.0.28 Output: HTML, Excel 2000 and PDF
While we are on the subject of documentation, here's one I wrote a long time ago to print out .mas files. We had a need to print out .mas files, indexes and Oracle table names. (I wrote this back when FOCUS field names were limited to 12 characters and file and segment names were limited to 8.) But I still find it handy since I all the indexes on the Oracle table. It produces an OFFLINE report but could be changed to PDF without much trouble.
APP PATH printmas
-*
-* Remove the existing output file from /opt/ibi/apps/reports
-* You may see an error message if output file is not generated yet
-*
-UNIX rm &&RPTPATH..masrpt.out
-*
-* Copy .mas and .acx file to execution folder
-*
-UNIX cp /opt/ibi/apps/masters/*.mas .
-UNIX cp /opt/ibi/apps/prodacx/*.acx .
-*
-* Create list of .mas files and redirect the output to a new file
-* named mas.list
-*
-UNIX ls -A *.mas > mas.list
SET MORE=OFF, MSG=OFF
FILEDEF MASLIST DISK mas.list ( LRECL 32 RECFM V
-RUN
-*
-* MASLOOP(Execution Loop) starts here
-*
-SET &LOOPCNT=0;
-*
-MASLOOP
-READ MASLIST NOCLOSE &MASNAME.A32.
-SET &LOOPCNT=&LOOPCNT+1;
-*-IF &LOOPCNT GT 50 THEN GOTO DONE;
-IF &IORETURN EQ 1 THEN GOTO DONE;
-IF &MASNAME EQ 'master.mas' THEN GOTO MASLOOP;
-IF &MASNAME EQ 'acx.mas' THEN GOTO MASLOOP;
-*
-UNIX cp &MASNAME master.ftm
-RUN
-*
-SET &UPMASNM=UPCASE(32,&MASNAME,'A32');
-SET &POS=POSIT(&MASNAME,32,'.',1,'I2');
-SET &POS=&POS+1;
-SET &ORANAME='N/A';
-SET &ACXNAME=OVRLAY(&MASNAME,32,'acx',3,&POS,'A32');
-*
-*Check the existence of .acx file for a corresponding .mas file
-*(retcode 0 is successful). If retcode is anything BUT 0 the control
-*will be passed to SKIPACX
-*
STATE &ACXNAME
-RUN
-SET &NOACX=&RETCODE;
-*
-IF &NOACX NE 0 THEN GOTO SKIPACX;
-*
-*If retcode is 0 the excution will resume as normal within MASLOOP
-*
FILEDEF ACX DISK &ACXNAME ( LRECL 80 RECFM V
-*
DEFINE FILE ACX
WKFILE1/A32=GETTOK(ACXREC,89,-1,'.',32,'A32');
WKFILE2/A32=CTRAN(32,WKFILE1,44,32,'A32');
FILENM/A32=UPCASE(32,WKFILE2,'A32');
END
-*
-* Get the file name now. It will be saved to SAVE file
-*
TABLE FILE ACX
PRINT FILENM
IF RECORDLIMIT EQ 1
ON TABLE SAVE
END
-*
? FILEDEF
DEFINE FILE ACX CLEAR
END
-*
FILEDEF ACX CLEAR
-RUN
-*
-* Read the ORACLE file name from SAVE file and clear the file
-*
-READ SAVE &ORANAME.A32.
-RUN
FILEDEF SAVE CLEAR
-RUN
-UNIX rm save.ftm
-*
-* Collect the indexes for a given table. Format and add as comments
-* to the corresponding Master File Description
-*
-SET &QT=HEXBYT(39,'A1');
-SET &TESTORA=&QT | &ORANAME || &QT;
-*
SET SQLENGINE=SQLORA
SQL SET SERVER &&KIDS_SERVER
SQL PREPARE LSTINDEX FOR
SELECT INDEX_NAME, SUBSTR(COLUMN_NAME,1,42) COLNM
FROM ALL_IND_COLUMNS
WHERE TABLE_NAME = &TESTORA
ORDER BY INDEX_NAME, COLUMN_POSITION ;
END
-*
OFFLINE
FILEDEF OFFLINE DISK master.ftm ( LRECL 89 RECFM V APPEND
-*
DEFINE FILE LSTINDEX
INDX_LINE/A89=' ' | INDEX_NAME | ' ' | COLNM;
END
-*
TABLEF FILE LSTINDEX
HEADING
" "
"======================================================================="
" "
" INDEXES "
" "
PRINT INDX_LINE AS ''
BY INDEX_NAME NOPRINT
ON INDEX_NAME SUBFOOT
" "
ON TABLE SET PAGE NOPAGE
END
-*
DEFINE FILE LSTINDEX CLEAR
END
-*
OFFLINE CLOSE
-RUN
-*
-* The SKIPACX starts here ( this part of code executes if retcode is
-* anything BUT 0
-*
-SKIPACX
-*
OFFLINE
FILEDEF MASTER DISK master.ftm ( LRECL 89 RECFM V
FILEDEF OFFLINE DISK masrpt.out ( LRECL 90 RECFM V APPEND
-*
TABLEF FILE MASTER
HEADING
"PAGE:<TABPAGENO><60>RUN DATE: &DATEMDYY </1>"
PRINT MASREC AS ''
FOOTING BOTTOM
"ORACLE: &ORANAME <56>FOCUS: &UPMASNM"
ON TABLE SET LINES 72
END
-*
OFFLINE CLOSE
FILEDEF OFFLINE CLEAR
FILEDEF MASTER CLEAR
-RUN
-UNIX rm master.ftm
-*
-* SKIPACX ends here and returns execution back to MASLOOP
-*
-GOTO MASLOOP
-*
-* DONE takes control of execution here( end of file). It will close the MASLIST file
-* and move output file (masrpt.out) to /opt/ibi/apps/reports folder
-*
-DONE
-CLOSE MASLIST
-RUN
-UNIX mv masrpt.out &&RPTPATH
I thought i had tried that yesterday, but maybe not, because that did the trick by removing the V
Prod: WebFOCUS 7.1, 7.13, 7.6 Test: DevStudio 7.1, 7.6 Servlet - Self Service - MS Windows XP SP2 - Apache Tomcat 5.0.28 Output: HTML, Excel 2000 and PDF
"multi terms" does not work as you may think, it acts as an OR, not an AND. I have gotten around this by doing a 2 steps, one to hold and the second to scan the held files.
/m - just the filenames/paths (default is to show the line of context, which is sometimes quite helpful).