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. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     How to check the existence of a file from within WebFOCUS Fex Code

Read-Only Read-Only Topic
Go
Search
Notify
Tools
How to check the existence of a file from within WebFOCUS Fex Code
 Login/Join
 
Gold member
posted
I remember there was a trick to check the existence of a disk file (by using WebFOCUS Fex Code).
I am not able to recollect what was the exact syntax .... does anybody know ?


WebFOCUS 5.3.3 MRE - Solaris - Sun Web Server - Weblogic
 
Posts: 85 | Registered: December 20, 2005Report This Post
Expert
posted Hide Post
in a windows environment you can
CMD STATE D:\IBI\APPS\..\filename.ext
-RUN
-IF &RETCODE NE 0 THEN you got no file.
also there was an interesting post by jg
and he says
!IF EXIST C:\ibi\apps\baseapp\NEWXHT.XLS (DEL C:\ibi\apps\baseapp\NEWXHT.XLS /F)
 
here's the link to that code




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Guru
posted Hide Post
or you can use the old DOS STATE

-* Note: zero is a good return code
DOS STATE \\IMPRS01\APPS\PMS\DATA\FTFLAG.DAT
-IF &RETCODE NE 0 GOTO NOFLAG;

then add appropriate labels and loop.



WebFOCUS 7.6.6/TomCat/Win2k3
 
Posts: 428 | Location: Springfield, MA | Registered: May 07, 2003Report This Post
Member
posted Hide Post
In the Unix/Linux environment, just use 'STATE' without the preceding CMS/DOS/etc. qualifier.
STATE filename.txt
-RUN
-IF &RETCODE EQ 0 GOTO FILEOK ;
-TYPE Error message
-GOTO ERREXIT

-FILEOK
... Rest of fex here
 
Posts: 15 | Location: New York | Registered: April 02, 2004Report This Post
Gold member
posted Hide Post
I am on Unix/Solaris. 'STATE' worked out for me. Thx.


WebFOCUS 5.3.3 MRE - Solaris - Sun Web Server - Weblogic
 
Posts: 85 | Registered: December 20, 2005Report This Post
Gold member
posted Hide Post
Alternatively,

-UNIX ls /path/to/your/file 1>/dev/null 2>/dev/null
-IF &EXITRC NE 0 THEN GOTO WHATEVER;


WF 7.1.6 moving to WF 7.7, Solaris 10, HTML,PDF,XL
 
Posts: 83 | Location: Dartmouth Hitchcock Medical Center | Registered: April 17, 2003Report 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     How to check the existence of a file from within WebFOCUS Fex Code

Copyright © 1996-2020 Information Builders