With OPENSEQ THEN is true if the record exists.  Else is ELSE when the
record does not exists.  ELSE does not mean an open error. Open error can be
checked from ON ERROR section.

Try something like

OPENSEQ "_HOLD_", "XHR.PLINK.BENDED.EXTRACT" TO f.xhr.plink.bended.extract
THEN

        Code section when "XHR.PLINK.BENDED.EXTRACT" exists in "_HOLD_" file
ELSE
        section when "XHR.PLINK.BENDED.EXTRACT" does not exists in "_HOLD_" 
END

Regards
Kafsat




-----Original Message-----
From: Chauhan, Savita [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 21 September 2004 7:37 AM
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/

This email and any attachments are confidential and intended solely for the
use of the person or entity to whom they are addressed. If you are not the
intended recipient, please do not disclose, store, copy or take any action
in reliance on it or them. If you have received this message in error,
please tell us by reply email (or telephone + 61 (0) 3 9274 9100) and delete
all copies on your system. Any opinion, advice or information in this email
is not necessarily that of the owners or officers of this company. Please
advise us immediately if you or your employer do not consent to email for
messages of this type. 

Retail Decisions has taken reasonable precautions to ensure that any
attachment to this email has been swept for viruses. However, we cannot
accept any liability for any damage sustained as a result of software
viruses, and would advise that you carry out your own virus checks before
opening any attachment. Please note that communications sent by or to any
person through our computer system may be viewed by other Retail Decisions
employees or officers strictly in accordance with law.
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to