Open the file both ways.  Then you can do a 
READ REC FROM FILEHANDLE, ID ELSE
  WRITE "" ON FILEHANDLE, ID
END
OPENSEQ..........

HTH, *=aee=*

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Chauhan, Savita
Sent: Monday, September 20, 2004 14:37
To: [EMAIL PROTECTED]
Subject: RE: [U2][UD] Create file/record if it does not exist


This is how I open my file. 
X.EXT.FILE = '_HOLD_/XHR.PLINK.BENDED.EXTRACT'
OPENSEQ X.EXT.FILE TO f.xhr.plink.bended.extract ELSE
        ERR.MSG = "Error Opening XHR.PLINK.BENDED.EXTRACT. Error code
":STATUS()
        CRT ERR.MSG
        RETURN
END

This code aborts with a status() of 0 if the file/record doesn't exist
under the _HOLD_ dicrecotry.
The successful read is 0 too. 

So I don't know how to check the existence or non-existence of this
file/record.

Please help.
Thanks.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Monday, September 20, 2004 2:16 PM
To: [EMAIL PROTECTED]
Subject: RE: [U2][UD] Create file/record if it does not exist

Have you tried using the ELSE clause with the OPENSEQ? That's how I
usually do it.


 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chauhan, Savita
Sent: Monday, September 20, 2004 1:44 PM
To: [EMAIL PROTECTED]
Subject: [U2][UD] Create file/record if it does not exist

Hi,

Is there a UniBasic command which will let me do the following:

------ Open a seq file. If it does not exist then create one and open
it. -------

The seq file that I want to create/open is in the _HOLD_ directory, so
its kinda record in the _HOLD_ file.

I thot of working with the STATUS code returned by OPENSEQ. But, it
returns a 0 if the record does not exist and the same 0 if it's a
successful open!!

How do I check the existence of this record/file?

Thanks.
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to