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! alerts - testing for presence of a file

Read-Only Read-Only Topic
Go
Search
Notify
Tools
SOLVED! alerts - testing for presence of a file
 Login/Join
 
Guru
posted
I'm trying to create an alert that will test to see if a file is present. However, I'm having trouble getting the alert to see the file. The documentation says to enter the full path of the file, which I suppose is
\\server\ibi\apps\baseapp\filename.txt. But when I place a file there, my DevStudio does not see it, and neither does the alert. The alert uses the STATE command, and I cannot find that documented anywhere. Thanks in advance.

This message has been edited. Last edited by: Mike in DeLand,


Webfocus 8
Windows, Linux
 
Posts: 258 | Location: Palm Coast, FL | Registered: February 05, 2010Report This Post
Master
posted Hide Post
Did you try -MRNOEDIT feature?
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Guru
posted Hide Post
I just tried that. I put -MRNOEDIT on the STATE line, but it did not help.

Here's the alert code:
  
-SET &ECHO=ALL;
APP SHOWPATH
-* Created by Alert Wizard
-* version 1.0
-* start of the test report
-* Restore State Command
-IF &FOCMODE EQ 'TSO' GOTO TSOSYS;
-IF &FOCMODE EQ 'MSO' GOTO TSOSYS;
-IF &FOCMODE EQ 'CRJE' GOTO TSOSYS;
-GOTO NOTTSO
-TSOSYS
? TSO DSNAME '\\hubappreports\ibi\WebFOCUS76\basedir\clerkofc\appmiketest.txt'
-IF &RETCODE NE 0 GOTO ALERTEXIT;
-GOTO AFTERFIL
-NOTTSO
-MRNOEDIT STATE \\hubappreports\ibi\apps\baseapp\miketest.txt
-* end of the test report
-* start of the test
-RUN
-IF &RETCODE NE 0 GOTO ALERTEXIT;
-AFTERFIL
-* end of the test
-* start of the output report
-* Description at creation time
-**get_facility
-INCLUDE app/get_facility.fex
-* end of the output report
-* start of the options
-* TWO_WAY_EMAIL=
-* TWO_WAY_EMAILDOMAIN=
-* TWO_WAY_EMAILDESCRIPTION=
-* TWO_WAY_EMAILFOLDER=
-* end of the options
-ALERTEXIT
-* End Alert Wizard


Webfocus 8
Windows, Linux
 
Posts: 258 | Location: Palm Coast, FL | Registered: February 05, 2010Report This Post
Virtuoso
posted Hide Post
I believe the STATE command must be preceded by the operating system command (with exception of TSO).

DOS STATE \\hubappreports\ibi\apps\baseapp\miketest.txt


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Guru
posted Hide Post
Hi,

I just tried that too. Still no good. I'm getting a -1 return code. Can you tell I'm new at this? Red Face


Webfocus 8
Windows, Linux
 
Posts: 258 | Location: Palm Coast, FL | Registered: February 05, 2010Report This Post
Master
posted Hide Post
Using -MRNOEDIT, in case of multiple lines use the below syntax.

-mrnoedit begin

-**** code to be executed in reporting server

-mrnoedit end
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Virtuoso
posted Hide Post
Sorry Mike, the OS command begins with a dash (-DOS) because it is Dialogue Manager.

-DOS STATE \\hubappreports\ibi\apps\baseapp\miketest.txt


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Master
posted Hide Post
In Developer Studio, only -DOS and -WINNT can be used.

DOS for DOS operating system.

WINNT for Windows operating system.
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Report This Post
Guru
posted Hide Post
ok, the -DOS STATE solved it! Thanks to everyone! I guess that's what I get for trusting the "wizard".


Webfocus 8
Windows, Linux
 
Posts: 258 | Location: Palm Coast, FL | Registered: February 05, 2010Report This Post
Guru
posted Hide Post
Looks like I spoke too soon. After using the -DOS STATE, I got a good return code indicating that the file was present. However, after deleting the file I'm still getting the same 0 return code. I found this out by trying to do the delete using the -DOS DEL command in the procedure. It also came back with return code 0, but the file was still there. So, I manually deleted the file, and now the -DOS STATE command still thinks it's there. Frowner


Webfocus 8
Windows, Linux
 
Posts: 258 | Location: Palm Coast, FL | Registered: February 05, 2010Report This Post
Expert
posted Hide Post
This is not a fully formed idea but what about doing a -DOS DIR filename > output.dat. You could then -READ and parse what is in the file.
D:\ibi\apps\c758760>dir x* > output.dat
File Not Found

D:\ibi\apps\c758760>more output.dat
 Volume in drive D is Data
 Volume Serial Number is 1C97-CCC9

 Directory of D:\ibi\apps\c758760

If the file is not there, there are only 4 lines in the output file. If the file is there, there will be more lines. You would even be able to parse the line to extract the time stamp.

What do you think?


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Guru
posted Hide Post
I think it should work as documented, that's what I think. But I appreciate your tip. I'm new to this, so the redirection, reading the file, etc. will take me some time to figure out.


Webfocus 8
Windows, Linux
 
Posts: 258 | Location: Palm Coast, FL | Registered: February 05, 2010Report This Post
Virtuoso
posted Hide Post
Mike, I agree that -DOS STATE should work. It also fails (with false positives) in my environment. It might be worth the trouble to open a case with IBI to see if they can sort it out. Here is another work-around to go with Ginny's suggestion. This assumes your file can always be found (when it exists) in an APP folder that is part of the APP path (baseapp in this example). APP QUERY creates a temporary list of all files from baseapp and also generates a master with the name FOCAPPQ. If the file exists &FILE_EXIST will have a value of 1; if not its value will be 0.

APP QUERY baseapp HOLD
-*
TABLEF FILE FOCAPPQ
 PRINT DATE
 WHERE FILENAME EQ 'miketest.txt';
 ON TABLE SAVE
END
-*
-RUN
-SET &FILE_EXIST = &LINES ;

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Guru
posted Hide Post
Thanks, Dan. I just now opened a case with IBI, but I'm also anxious to try your suggestion (on Monday - I'm out of here!)


Webfocus 8
Windows, Linux
 
Posts: 258 | Location: Palm Coast, FL | Registered: February 05, 2010Report This Post
Expert
posted Hide Post
Clever, Dan. I like it. Good One


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Virtuoso
posted Hide Post
I have to give credit to knegrotto for the idea. knegrotto's post entitled "Retrieving file object attributes" from Feb. 10th (link below) provides an excellent example of using APP QUERY.

http://forums.informationbuild...71057331/m/811100763

This message has been edited. Last edited by: Dan Satchell,


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Virtuoso
posted Hide Post
great solution
thanks




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, 2006Report This Post
<JG>
posted
quote:
-DOS STATE \\hubappreports\ibi\apps\baseapp\miketest.txt

The correct way to use STATE is

DOS STATE absolute-filename or absolute-directory name

DOS STATE C:\Windows

is valid and retorns 0 if the directory exists and -1 if it does not exist

DOS STATE C:\Windows\twain_32.dll

is valid and retorns 0 if the file exists and -1 if it does not exist


However DOS STATE does not work with UNC naming

so

DOS STATE \\machinename\shared_folder_name\filename

is not valid
 
Report This Post
Guru
posted Hide Post
Thanks for your response. I tried mapping a drive, then doing the STATE command pointing to my drive letter and folders. Still didn't work. I've got a remote session scheduled with IBI in about half an hour. I've got to be doing something wrong here.


Webfocus 8
Windows, Linux
 
Posts: 258 | Location: Palm Coast, FL | Registered: February 05, 2010Report This Post
Virtuoso
posted Hide Post
What would happen if you did a net use first? Haven't tried this, but it might work. You would need to have a share on the remote machine somewhere along the path to the file you testing for. You then say something like NET USE Q: \\machine\named_share and follow this with the dos state q:\....\filename.txt
Did not test this, but it might work ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Virtuoso
posted Hide Post
Mike,
Our comments crossed each other.
Did you do the drive mapping using the net use command or just in the explorer?
If the latter, then your server will not see it, becaus eit will only see the drives mapped when you start the service.
If you do the net use in your fex, the server will see it.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Guru
posted Hide Post
quote:
Originally posted by Dan Satchell:
Mike, I agree that -DOS STATE should work. It also fails (with false positives) in my environment. It might be worth the trouble to open a case with IBI to see if they can sort it out. Here is another work-around to go with Ginny's suggestion. This assumes your file can always be found (when it exists) in an APP folder that is part of the APP path (baseapp in this example). APP QUERY creates a temporary list of all files from baseapp and also generates a master with the name FOCAPPQ. If the file exists &FILE_EXIST will have a value of 1; if not its value will be 0.

APP QUERY baseapp HOLD
-*
TABLEF FILE FOCAPPQ
 PRINT DATE
 WHERE FILENAME EQ 'miketest.txt';
 ON TABLE SAVE
END
-*
-RUN
-SET &FILE_EXIST = &LINES ;


Dan, this solved the problem! It turns out that due to our overly-complex installation and environment, that I was not even looking in the right place for the file. Once we got that sorted out, I worked with IBI on the STATE command that the Alert Wizard created (which still does not work). So, today I tried your solution with success. Thanks.


Webfocus 8
Windows, Linux
 
Posts: 258 | Location: Palm Coast, FL | Registered: February 05, 2010Report 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! alerts - testing for presence of a file

Copyright © 1996-2020 Information Builders