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 would like to save all my run-time &variables, starting '&V_' to a file. So something similar to what I would get if I issued the following command:
-? &V
I have been reading the following thread where Ginny shows how to output column names to variables. I have tried to modify this code to write my &variables but without any luck.
I also tried the following in hope it would write out the variables, but alas that would have been too easy!
FILEDEF MARK_TEST DISK /home/iadmindev/ibi/apps/mark/test.fex -RUN
-WRITE MARK_TEST -? &V
Any thoughts?This message has been edited. Last edited by: Kerry,
WebFocus 765. iSeries v5r4
Posts: 175 | Location: England | Registered: April 11, 2006
I'm glad you liked my previous post. However, I don't think you can -WRITE the output of a command to a specific file the way you tried.
The output of -? is going to the 'terminal' so I think what you would need to do, shades of old mainframe days, would be to filedef the terminal. Not sure what the ddname is these days. You could try TRMOUT.
So it would be something like this:
FILEDEF TRMOUT DISK whereever_you_want_to_put_it -? &V
I've been trying something on my environment (which is NOT as400, but windows). I think however that is should be possible to modify the code so that it also runs on as400. My code is as follows:
SET TRACEOFF = ALL
SET TRACEON = ALL
SET TRACESTAMP=OFF
SET TRACEUSER=C:\TEMP\MARK.TRC
-RUN
-? &
SET TRACEOFF = ALL
-RUN
FILEDEF MASTER DISK TRACE.MAS
FILEDEF TRACE DISK C:\TEMP\MARK.TRC
-RUN
-WRITE MASTER FILENAME=TRACE, SUFFIX=FIX
-WRITE MASTER SEGNAME=TRACE
-WRITE MASTER FIELDNAME=LINE, FORMAT=A200, ACTUAL=A200, $
-RUN
DEFINE FILE TRACE
RESULT/A155 = SUBSTR(200,LINE,45,200,155,RESULT);
AMPER/A1 = EDIT(RESULT,'9');
END
TABLE FILE TRACE
PRINT RESULT
IF LINE CONTAINS 'ngput'
IF AMPER EQ '&'
END
On Windows this gives me a report with just the amper variables currently active. Hope this helps..... and that you can convert it to and use it on the as400.
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
GamP, that is very creative! I really like this solution.
For a cross-platform version, I would use the TEMPPATH function to determine where to save the trace file, so with a little tweak for the TRACEUSER setting, this has been tested on UNIX and Windows and works on both.
-SET &ECHO=ALL;
-SET &TEMPDIR = TEMPPATH(60,'A60');
-SET &TRACEFILE = &TEMPDIR || 'trace.trc';
SET TRACEOFF = ALL
SET TRACEON = ALL
SET TRACESTAMP=OFF
SET TRACEUSER=&TRACEFILE
-RUN
-? &
SET TRACEOFF = ALL
-RUN
FILEDEF MASTER DISK trace.mas
FILEDEF TRACE DISK trace.trc
-RUN
-WRITE MASTER FILENAME=TRACE, SUFFIX=FIX
-WRITE MASTER SEGNAME=TRACE
-WRITE MASTER FIELDNAME=LINE, FORMAT=A200, ACTUAL=A200, $
-RUN
DEFINE FILE TRACE
RESULT/A155 = SUBSTR(200,LINE,45,200,155,RESULT);
AMPER/A1 = EDIT(RESULT,'9');
END
TABLE FILE TRACE
PRINT RESULT
IF LINE CONTAINS 'ngput'
IF AMPER EQ '&'
END
Thanks very much GamP.
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
GamP your solution with Francis's small mod works just right for us, thank you very much!
…
Also , if I may sneak in one last query with you all:
Every so often my Developer Studio decides to not allow me to edit a file when I right-click on it. Instead of getting the usual options "Open, Edit, Run, Print, Copy" etc, all I can do is "Run, Copy, Properties". I usually have to restart Dev Studio to get all the options back, but then sometimes it breaks again within minutes - todays has been particularly bad! Our other Developer doesn't have any problems, any ideas what am I doing wrong?! I guess somehow I am loosing my access rights?
WebFocus 765. iSeries v5r4
Posts: 175 | Location: England | Registered: April 11, 2006
I'm assuming that your reporting server is running under OPSYS security as ours is. And are you talking about Data Servers or which area of Dev. Studio. We are all Data Servers and sometimes have that issue. Our users store their operating system credentials in Show Environments. It appears that the cookie disappears or gets corrupted on occasion.
I have a little focexec that I have them run that tells them who is logged on.
-* File check_logon.fex
-*************************************************************
-SET &USERID=GETUSER('A8');
-TYPE THE USERID FROM GETUSER IS &USERID
Unfortunately, sometimes the right id shows. It is a head-scratcher.
gamps idea is really cool... if you want a rather pedestrian way, you can take your initial idea and just tweak it a bit say you have 10 &variables in your fex and you know what they are called...which you should, right? FILEDEF MARK_TEST DISK /home/iadmindev/ibi/apps/mark/test.fex -RUN
-WRITE MARK_TEST NOCLOSE &var1 -WRITE MARK_TEST NOCLOSE &var2 -WRITE MARK_TEST NOCLOSE &var3 -WRITE MARK_TEST NOCLOSE &var4 ... etc -CLOSE MARK_TEST (I'm not sure the CLOSE is right, i use it and it works, but i think i made it up .. that's the thing with Focus, its a language so sometimes you make stuff up and it works!) The NOCLOSE is important , it keeps from overwriting the same line.. kinda like a FILEDEF..(APPEND I do this at run time for every one of my fexes.. -WRITE MYFILE &USERID &FEXNAME &DATE &TOD &ARANDOMNUMBER and then all their &var values and then MODIFY big log file..(hence the random number) Big Brother is watching...
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
I'm assuming that your reporting server is running under OPSYS security as ours is. And are you talking about Data Servers or which area of Dev. Studio. We are all Data Servers and sometimes have that issue. Our users store their operating system credentials in Show Environments. It appears that the cookie disappears or gets corrupted on occasion.
I have a little focexec that I have them run that tells them who is logged on.
-* File check_logon.fex
-*************************************************************
-SET &USERID=GETUSER('A8');
-TYPE THE USERID FROM GETUSER IS &USERID
Unfortunately, sometimes the right id shows. It is a head-scratcher.
Thanks Ginny, I was refering to the Data Servers. I will have to speak to our Techie and see if can shed some light on it and will check my logon user value when it next happens.
quote:
Originally posted by smiths: Mark,
Also note that if you want to check if an amper variable exists, you can use the EXISTS function, as in:
-SET &CASTER=IF &DSTSCHEDID.EXISTS EQ 1 THEN 'Y' ELSE 'N';
quote:
Originally posted by susannah: gamps idea is really cool... if you want a rather pedestrian way, you can take your initial idea and just tweak it a bit say you have 10 &variables in your fex and you know what they are called...which you should, right? …..
Thanks Sean / Susannah,
The great thing about this script is that I don’t want/have to specify each and every run-time variable, it will just dump them out for me. This is necessary as many reports will be making use of it, all with different &variables.
To give more of an insight into its use:
All our reports end with a call to a Log scipt. This updates a log file, with details such as Report_ID, User, Report, Date, Start Time, End Time, Runtime, Rows Returned etc.
I have now coded an option to run this new script ‘ report dump’, if the report is one we want to monitor, or if the number of rows returned exceed a cetain value, or even if a report runs for too long.
This will allow us to be more effective in trying to improve the reports running on the system. Instead of having to email a user and say ‘Your report ran for 15 minutes, what did you enter?’, we can now just find the report dump which is saved under a the Report_ID.
Using a looping method (which is new to me in WebFocus) seen in Ginny’s other thread, I have been able to modify the dump script to divide the &variables into sections, each with headings. Therefore my dump now looks more like:
-* ------------------------------------------------------------------------------------------------------------------ -* Report Dump For ‘Mark Test Report’ -* ------------------------------------------------------------------------------------------------------------------
-* ------------------------------------------------------------------------------------------------------------------ -* USER DEFINED COLUMNS: -* ------------------------------------------------------------------------------------------------------------------
But I have a problem: the "-? &" in it is echoed into the html page and is viewable via "view source". Is there any way of stopping this? I have been searching site.wfs config but I really can't find anything.
Many thanks Roy
8.0.0.6, Ubuntu 12.04, All
Posts: 12 | Location: South Africa | Registered: February 07, 2007
But I have a problem: the "-? &" in it is echoed into the html page and is viewable via "view source". Is there any way of stopping this? I have been searching site.wfs config but I really can't find anything.
Any ideas anyone?
8.0.0.6, Ubuntu 12.04, All
Posts: 12 | Location: South Africa | Registered: February 07, 2007
but see, that's the whole point of turning on the trace...you're trapping the console...if it doesn't appear on the console...it can't be trapped in the trace output.
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
Thanks susannah but I'm not troubled by actually having the "-? &" command but rather that its result is returned in the html page. When it comes to composing the final page that is returned to the browser there must be a way of stopping the html comment from being included at the end of the displayable part of the page. (i.e. why does console output *need* to be returned to the user?)
8.0.0.6, Ubuntu 12.04, All
Posts: 12 | Location: South Africa | Registered: February 07, 2007
But I have a problem: the "-? &" in it is echoed into the html page and is viewable via "view source". Is there any way of stopping this? I have been searching site.wfs config but I really can't find anything.
I'm sure you have: -SET &ECHO=OFF; so, the source code is not displayed.
Then turn off the right-click option for the HTML page.
Thanks for all the responses! Just to clarify I have included an edited html page below. It is on "view source" that the amper-variables become visible when you use this technique. My reasoning is that at the final composition of the page .. a function I believe is performed by the WebFOCUS Client .. the {!-- comment --} section is appended to the displayable report ('}' replaces left and right angle bracket). A want to prevent this part being displayed since some amper-variables contain more sensitive data that I don't want savy users having access to. I would have hoped that some configuration setting for the WF Client could altogether stop it from appending the html comment to the end of the page but I don't know what setting that is or whether it in fact exists. There is something in that line on TechSupport as a Technique: How to prevent "View Source" from revealing && variables? However this is not quite there
How to prevent "View Source" from revealing && variables? Many of these variables contain sensitive information that should not be displayed to someone in the view source of html reports.
Solution:
In the /ibi/client53/wfc/etc/default.wfs file, the _ibi_get_ampers variable is used to issue a '-? &&' command, whenever IBIF_persistentamp is set to "YES": <if> IBIF_persistentamp.upper EQ "YES" _ibi_get_ampers=-TYPE <AMPERS>\n-? &&&&\n-TYPE </AMPERS> <else>
_ibi_get_ampers=\n <endif>
To prevent this, _ibi_get_ampers can be set to nothing whether IBIF_persistentamp is set to "YES" or "NO". Example: <if> IBIF_persistentamp.upper EQ "YES" <! _ibi_get_ampers=-TYPE <AMPERS>\n-? &&&&\n-TYPE </AMPERS> > _ibi_get_ampers=\n <else>
_ibi_get_ampers=\n <endif>
This will comment out the line contained between <! and >. Then _ibi_get_ampers is set to nothing whether IBIF_persistentamp is set to "YES" or "NO".
Before modifying the default.wfs file, please make a backup copy first. Then after modifying the file and saving the changes, you will need to stop the IIS Admin service and then start the World Wide Web Publishing service for the changes to take effect.
RoyD, The output will always be echoed in the html comment section. It is just the result of a command, and thus it will be included in the result set. I have not been able to find a way to not show the output. I can only think of one way to do this, and that is to have it executed in the manner of how the html painter executes a fex to populate a drop-down box. The result of that process is never shown in the comments of the resulting html. Maybe you can do some research into that area?
BTW, Frances' tweak is not really needed. If you just specify a filename without a path in front of it, it will automatically be placed in the temporary directory.
Susannah/Waz: I'll think about submitting.
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
Many thanks GamP. At this stage it probably isn't do-able, then. I might post it on TechSupport with IBI and see.
I don't use the Painters but I think they might be using an Ajax approach in which case any comments would be discarded (I tried it on some of my own stuff and that is what happened)
All the best Roy
8.0.0.6, Ubuntu 12.04, All
Posts: 12 | Location: South Africa | Registered: February 07, 2007