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     [CLOSED] CHECK FILE for a file on DISK (not on WebFOCUS server).

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] CHECK FILE for a file on DISK (not on WebFOCUS server).
 Login/Join
 
Master
posted
Can someone provide me a pointer as to why this is not working? I can find lots of info on CHECK FILE holdname HOLD, but not any on named DISK locations. I'm sure this is something simple, can someone point me right?

In a nutshell, this accepts 4 parameters from a querystring (one being &HTMNAME), and writes a file in that location. (this all works perfectly). Before doing that write, I'd like to make sure the file doesn't already exist. This seems to be giving me some fits. Any ideas?

Alternately, how would you read a return code from a DOS command (such as DIR-ing it)? Rather not go that way, but if I have to.....

APP HOLD HELDFILES
APP HOLDMETA HELDFILES
APP HOLDDATA HELDFILES

-SET &RPTNAME = '\\server\share$\folder\' | &HTMNAME ;

FILEDEF BOEFINAL DISK "&RPTNAME"



-IF &LINES GT 0 THEN WRITEFILE ELSE NOWRITE;
-CONTINUE




-WRITEFILE
DEFINE FILE CAR
	ORDER/A1     = '1';
	OUTLINE/A300 = '<!-- Report: &RPTTITLE -->';
END

TABLE FILE CAR
PRINT
	ORDER
	OUTLINE

BY COUNTRY NOPRINT
WHERE RECORDLIMIT EQ 1;
ON TABLE HOLD AS BT_TEMP_1
END



DEFINE FILE CAR
	ORDER/A1     = '2';
	OUTLINE/A300 = '<!-- CUID:   &CUID     -->';
END

TABLE FILE CAR
PRINT
	ORDER
	OUTLINE

BY COUNTRY NOPRINT
WHERE RECORDLIMIT EQ 1;
ON TABLE HOLD AS BT_TEMP_2
END



DEFINE FILE CAR
	ORDER/A1     = '3';
	OUTLINE/A300 = '<meta HTTP-EQUIV=''REFRESH'' content=''0; url=http://server.com:8080/CrystalReports/viewrpt.cwr?cmsname=mycms.com:6400&|id=&RPTID&|apsuser=username&|apspassword=password&|apsauthtype=secEnterprise''>';
END

TABLE FILE CAR
PRINT
	ORDER
	OUTLINE

BY COUNTRY NOPRINT
WHERE RECORDLIMIT EQ 1;
ON TABLE HOLD AS BT_TEMP_3
END




TABLE FILE BT_TEMP_1
PRINT
	ORDER
	OUTLINE

ON TABLE HOLD AS BT_OUT

MORE
FILE BT_TEMP_2

MORE
FILE BT_TEMP_3

END




TABLE FILE BT_OUT
PRINT
OUTLINE
BY ORDER NOPRINT
ON TABLE HOLD AS BOEFINAL FORMAT ALPHA
END
-GOTO THEEND




-NOWRITE
-HTMLFORM BEGIN

<html>
<body>

<h1>File Exists, Exiting</h1>

<body>
<html>

-HTMLFORM END
-GOTO THEEND



-THEEND

This message has been edited. Last edited by: ABT,


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
 
Posts: 561 | Registered: February 03, 2010Report This Post
Expert
posted Hide Post
STATE will test for the existance of a file.

You can test for the results with &RETCODE.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Master
posted Hide Post
Waz,
I've looked through several of the manuals and searched the site and web for State, but keep getting results about all the states (i.e. municipalities) that are deploying WebFOCUS. Can you point me to some documentation?

I also found this (http://solution.ibi.com:8080/91591076.html) earlier today, but it looks like it deals with VMS (even though it is identified as a WinNT related item).

Sorry to be so needy.

- ABT

This message has been edited. Last edited by: ABT,


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
 
Posts: 561 | Registered: February 03, 2010Report This Post
Expert
posted Hide Post
I think STATE is an OS command.

Works on Windows and Unix.

http://documentation.informati...ource/test_debug.htm

We use it without the OS call DOS, UNIX.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Master
posted Hide Post
Do you know of any issues with it reading from UNC's? I am looking at a directory with three files that all exist and when I try them, I get that they do not exist.

-SET &RPTNAME = '\\caperomain\EpicReports$\ABT\This File.htm';

DOS STATE "&RPTNAME"
-EXIT


Reply
------------------------------------------------

No HTML Output!

------------------------------------------------

 File doesn't exist


Kinda feeling a little like I'm in the twilight zone.

- ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
 
Posts: 561 | Registered: February 03, 2010Report This Post
Expert
posted Hide Post
I'm not aware of any issues, but test, test, test, to be sure.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Master
posted Hide Post
Looks like I'm not the only one: http://forums.informationbuild...71057331/m/586109863

So looks like I'm going to plan B. No UNC support, iffy support for mapped drives, better support for files in APP PATH (a bridge I am not willing to cross for this). sigh. deflated.

- ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
 
Posts: 561 | Registered: February 03, 2010Report This Post
Platinum Member
posted Hide Post
ABT,

I have fex that I use to capture config files that use check to see config backup folder exist first. I include here as you might find useful the method?

Kofi

-* File capture_config77.fex
-* -SET &InstDir  = EDIT(&&EDACONF,'999999');
-SET &InstDir  = GETTOK('&APPROOT.EVAL', &APPROOT.LENGTH, 1, '\', &APPROOT.LENGTH, 'A&APPROOT.LENGTH')||'\'||GETTOK('&APPROOT.EVAL', &APPROOT.LENGTH, 2, '\', &APPROOT.LENGTH, 'A&APPROOT.LENGTH');
-SET &ConfRoot = &InstDir || '\config_files';
-RUN
CMD IF EXIST &ConfRoot.. DEL &ConfRoot.. /S /Q
-RUN
CMD IF NOT EXIST &ConfRoot..\WebFOCUS77\Client\wfc\etc   MKDIR &ConfRoot..\WebFOCUS77\Client\wfc\etc
CMD IF NOT EXIST &ConfRoot..\WebFOCUS77\ReportCaster\cfg MKDIR &ConfRoot..\WebFOCUS77\ReportCaster\cfg
CMD IF NOT EXIST &ConfRoot..\WebFOCUS77\Config           MKDIR &ConfRoot..\WebFOCUS77\Config
CMD IF NOT EXIST &ConfRoot..\WebFOCUS77\Utilities        MKDIR &ConfRoot..\WebFOCUS77\Utilities
CMD IF NOT EXIST &ConfRoot..\WebFOCUS77\Utilities\SetEnv MKDIR &ConfRoot..\WebFOCUS77\Utilities\SetEnv
CMD IF NOT EXIST &ConfRoot..\Srv77\etc                   MKDIR &ConfRoot..\Srv77\etc
CMD IF NOT EXIST &ConfRoot..\Srv77\bin                   MKDIR &ConfRoot..\Srv77\bin
-RUN
-SET &&EDACLNT = &InstDir || '\WebFOCUS77';
-SET &&RPTCAST = &InstDir || '\WebFOCUS77\ReportCaster';
-* Client Server
-SET &CgiVars = &&EDACLNT || '\client\wfc\etc\cgivars.wfs';
-SET &CltSite = &&EDACLNT || '\client\wfc\etc\site.wfs';
-SET &CltOdin = &&EDACLNT || '\client\wfc\etc\odin.cfg';
-SET &MrRealm = &&EDACLNT || '\config\mrrealm.cfg';
-SET &RealmUt = &&EDACLNT || '\utilities\realm\realmutil.bat';
-SET &RealmMi = &&EDACLNT || '\utilities\realm\realmmigrate.bat';
-SET &UserVar = &&EDACLNT || '\utilities\setenv\utiluservars.bat';
-* Report Caster Server
-SET &DServer = &&RPTCAST || '\cfg\dserver.xmls';
-* EDA Server
-SET &Edaprof = &&EDACONF || '\etc\edasprof.prf';
-SET &EdaOdin = &&EDACONF || '\etc\odin.cfg';
-SET &EdaServ = &&EDACONF || '\bin\edaserve.cfg';
-RUN
-*
CMD copy &CgiVars &ConfRoot..\WebFOCUS77\Client\wfc\etc
CMD copy &CltSite &ConfRoot..\WebFOCUS77\Client\wfc\etc
CMD copy &CltOdin &ConfRoot..\WebFOCUS77\Client\wfc\etc
CMD copy &MrRealm &ConfRoot..\WebFOCUS77\Config
CMD copy &RealmUt &ConfRoot..\WebFOCUS77\Utilities
CMD copy &RealmMi &ConfRoot..\WebFOCUS77\Utilities
CMD copy &UserVar &ConfRoot..\WebFOCUS77\Utilities\SetEnv
CMD copy &DServer &ConfRoot..\WebFOCUS77\ReportCaster\cfg
-*
CMD copy &Edaprof &ConfRoot..\Srv77\etc
CMD copy &EdaOdin &ConfRoot..\Srv77\etc
CMD copy &EdaServ &ConfRoot..\Srv77\bin
-RUN


Client Server 8.1.05: Apache; Tomcat;Windows Server 2012
Reporting Server 8.1.05; Oracle; MS SQL; Windows Server 2012
 
Posts: 106 | Registered: April 06, 2009Report This Post
Master
posted Hide Post
My target directory is not in the APPROOT.

-ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
 
Posts: 561 | Registered: February 03, 2010Report This Post
Platinum Member
posted Hide Post
ABT,

I am knowing that but the principle for check is same. e.g. you need check using CMD IF EXIST "&RPTNAME".

I not give solution just idea of possible method.

Kofi


Client Server 8.1.05: Apache; Tomcat;Windows Server 2012
Reporting Server 8.1.05; Oracle; MS SQL; Windows Server 2012
 
Posts: 106 | Registered: April 06, 2009Report This Post
Platinum Member
posted Hide Post
ABT, check this link.



In FOCUS since 1985 - WF 8.009/8.104 Win 8 Outputs: ALL of 'em! Adapters: Sql Server Teradata Oracle
 
Posts: 161 | Location: Dallas, TX | Registered: February 20, 2009Report This Post
Expert
posted Hide Post
I just tested a UNC file with STATE and it works OK.

Could your issue be with privileges from the WebFOCUS servers point of view ?

Can you DIR the location or the file ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Master
posted Hide Post
Thanks Everyone for your help. This is working:

-*Works!!!
-SET &RPTNAME = '\\server1\EpicReports$\ABT\THIS FILE1.HTM';

-*Works!!!
-*-SET &RPTNAME = '\\server2\d$\temp\' | &HTMNAME;

-TYPE &|RPTNAME = &RPTNAME


CMD STATE &RPTNAME
-RUN


-IF &RETCODE EQ 0 GOTO FOUND ELSE GOTO NOTFOUND;

-FOUND
-TYPE &RPTNAME Exists &|RETCODE = &RETCODE
-GOTO DONE

-NOTFOUND
-TYPE &RPTNAME Doesn't Exist &|RETCODE = &RETCODE
-GOTO DONE


-DONE
-EXIT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
 
Posts: 561 | Registered: February 03, 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     [CLOSED] CHECK FILE for a file on DISK (not on WebFOCUS server).

Copyright © 1996-2020 Information Builders