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 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,
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
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.
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.
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.
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, 2007
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.
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.
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, 2007
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, 2007
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.