Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Test if a file exist
Go
New
Search
Notify
Tools
Reply
  
Test if a file exist
 Login/Join
 
Member
posted
Sorry for my english, it is not very good.

I try to test if a file exist in the way of conditionning my prodecure (focus format : UFILE for example). I don't find the solution in my books.

Can you help please?
 
Posts: 7 | Registered: April 16, 2007Reply With QuoteReport This Post
Master
posted Hide Post
Use the STATE command, then check &RETCODE. It will be 0 if the file exists or -1 if it does not exist.

STATE pathname/car.foc
-RUN
-IF &RETCODE NE -1 THEN GOTO SKIP_CREATE;
-*
CREATE FILE CAR
-RUN
-SKIP_CREATE


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 950 | Location: Oklahoma City | Registered: October 27, 2006Reply With QuoteReport This Post
Expert
posted Hide Post
Interesting.

I couldn't find the STATE command in my WF 5.3.2 documentation.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteReport This Post
Virtuoso
posted Hide Post
In 7.1.3 docs, Developing Reporting Applications, it gets a very minor role with &RETCODE on page 6-91! Initially it was DOS STATE, but STATE works now.

It is a v. useful command.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Reply With QuoteReport This Post
Expert
posted Hide Post
Is STATE an operating system command? I've just run it on a Windows PC and a UNIX server., but I don't think this will work on a MVS system. You may need to use

-? TSO DSNAME 'FOCUS.DB.NAME' and then check &RETCODE.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteReport This Post
Virtuoso
posted Hide Post
I think that STATE was VM (am getting old and forgetful) and ported to PC and thence Unix, so would not work on MVS, maybe not on AS400 either.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Reply With QuoteReport This Post
Member
posted Hide Post
Thanks. The idea appeal to me.... but the STATE command does not exist :
" (FOC1517) COMMANDE NON RECONNUE STATE UPNBCE1"

They don't install all the functionnality of WF
Version : 526
Gen : 061804

Confused
 
Posts: 7 | Registered: April 16, 2007Reply With QuoteReport This Post
Member
posted Hide Post
Thanks for the command.
"-? TSO DSNAME 'path/dsname' "

My procedure is OK.

Thank you very much

Smiler
 
Posts: 7 | Registered: April 16, 2007Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Delphine,

Si STATE n'est pas reconnu et "-TSO DDNAME ..." l'est, cela veut peut-etre dire que le serveur de WebFocus est MVS. Sur ce systeme la commande n'existe pas. Sur les autres (VM, WIN, UNIX, LINUX etc.), oui.
Bon FOCUS!


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1949 | Location: Tel Aviv, Israel | Registered: March 23, 2006Reply With QuoteReport This Post
Member
posted Hide Post
Daniel,

En effet le serveur de WF est MVS .... Par contre sais-tu comment récupérer le path name afin d'éviter de la mettre en dur pour utiliser "-? TSO DSNAME 'path.nomfic' " ?

J'ai essayé ça sur un fichier existant et le DSNAME est à blanc ....
-? TSO DDNAME 'fic'


quote:
Originally posted by Danny-SRL:
Delphine,

Si STATE n'est pas reconnu et "-TSO DDNAME ..." l'est, cela veut peut-etre dire que le serveur de WebFocus est MVS. Sur ce systeme la commande n'existe pas. Sur les autres (VM, WIN, UNIX, LINUX etc.), oui.
Bon FOCUS!
 
Posts: 7 | Registered: April 16, 2007Reply With QuoteReport This Post
Master
posted Hide Post
Look up the command WHENCE


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 568 | Location: Baltimore, MD | Registered: July 06, 2006Reply With QuoteReport This Post
Master
posted Hide Post
More specifically...

check this out...


Good day! Idea


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 568 | Location: Baltimore, MD | Registered: July 06, 2006Reply With QuoteReport This Post
Master
posted Hide Post
More specifically, check this out...
<http://techsupport.informationbuilders.com/sps/73531034.html>

Good day!
Idea


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 568 | Location: Baltimore, MD | Registered: July 06, 2006Reply With QuoteReport This Post
Platinum Member
posted Hide Post
'State' tests for the existence of a file or ds. Been using it since back in mainframe focus 3.8 ( sheesh so long ago)...


aix-533,websphere 5.1.1,apache-2.0,
wf 538(d), 537 (p),
==============
7.6.11 (t) aix 5312
websphere 6.1.19
apache 2.0
 
Posts: 195 | Registered: October 27, 2006Reply With QuoteReport This Post
Expert
posted Hide Post
I would guess NOT on MVS Mainframe.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteReport This Post
Expert
posted Hide Post
Unfortunately the WHENCE command will not really help Delphine, I think she requires a method to retrieve the DSNAME into a Dialogue Manager variable which is then used in the -? TSO DSNAME command, n'est-ce pas?

Normally,
-? TSO DDNAME [i]ddname[/i]
should work, if, of course, the DDNAME in question is actually allocated to the FOCUS session. If the file exists, &DSNAME is populated with the DSNAME, if it does not exist, &DSNAME is set to blank.

Delphine, is it possible that the file is not allocated to the FOCUS session?


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteReport This Post
Member
posted Hide Post
Exactly! And I can check the DSNAME with -? TSO DDNAME .... I try it but i write it wrongly.... (sorry my english is very bad)...

It's OK now... thanks a lot

quote:
Originally posted by Francis Mariani:
Unfortunately the WHENCE command will not really help Delphine, I think she requires a method to retrieve the DSNAME into a Dialogue Manager variable which is then used in the -? TSO DSNAME command, n'est-ce pas?

Normally,
-? TSO DDNAME [i]ddname[/i]
should work, if, of course, the DDNAME in question is actually allocated to the FOCUS session. If the file exists, &DSNAME is populated with the DSNAME, if it does not exist, &DSNAME is set to blank.

Delphine, is it possible that the file is not allocated to the FOCUS session?
 
Posts: 7 | Registered: April 16, 2007Reply With QuoteReport This Post
Expert
posted Hide Post
Delphine,

Accent Québécois, Français ou…?


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteReport This Post
Member
posted Hide Post
Francis,

Française.... Smiler
Si je peux écrire français... chouette...
Au fait .... j'ai un soucis avec -? DSNAME et DDNAME ...!!

La façon dont c'est monté le DSN est créé automatiquement en début d'exécution en batch... à tous les coups il le trouve alors que le master n'est pas créé.... dommage.... ça marchait très bien en intéractif

Have a good day ....
Delphine

quote:
Originally posted by Francis Mariani:
Delphine,

Accent Québécois, Français ou…?
 
Posts: 7 | Registered: April 16, 2007Reply With QuoteReport This Post
Expert
posted Hide Post
On n'a pas besoin d'un Master pour les commandes -? TSO DSNAME/DDNAME. Pour garder le Master crée par ON TABLE HOLD AS ..., assigner DDNAME HOLDMAST a un PDS existant.

Sorry, my written French is not perfect.

I don't think we need a Master to execute -? TSO DSNAME/DDNAME. To keep a Master created by ON TABLE HOLD AS ..., allocate DDNAME HOLDMAST to an existing PDS.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteReport This Post
Member
posted Hide Post
you write french more than me for english.... (oouuuhh lala....)
i find my problem.... i read my file in the beginning of the procedure and at the end i create it "again" ... the problem is that at the beginning the file out is deleted... i change my procedure in the way of using two files ... and it's ok now..

thanks a lot for your help ...

Delphine

quote:
Originally posted by Francis Mariani:
On n'a pas besoin d'un Master pour les commandes -? TSO DSNAME/DDNAME. Pour garder le Master crée par ON TABLE HOLD AS ..., assigner DDNAME HOLDMAST a un PDS existant.

Sorry, my written French is not perfect.

I don't think we need a Master to execute -? TSO DSNAME/DDNAME. To keep a Master created by ON TABLE HOLD AS ..., allocate DDNAME HOLDMAST to an existing PDS.
 
Posts: 7 | Registered: April 16, 2007Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Test if a file exist

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.