Here is one approach.

OPEN.DIR.FILE:* Open sequential output file
  DIR.FILE = "_PH_"
  OPEN DIR.FILE TO F.DIR.FILE THEN
    DELETE F.DIR.FILE, OUTPUT.NAME
    CLOSE F.DIR.FILE
    OPENSEQ DIR.FILE, OUTPUT.NAME TO F.DIR.FILE ELSE
      IF STATUS() THEN
        ABORT.FLAG = TRUE
        MSG = "Can't open ":DIR.FILE:", ":OUTPUT.NAME:" for output."
      END
    END
  END ELSE
    ABORT.FLAG = TRUE
    MSG = "Can't open ":DIR.FILE:"!"
  END
  RETURN

David A. Green
(480) 813-1725
DAG Consulting

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Al DeWitt
Sent: Wednesday, September 08, 2010 3:55 PM
To: [email protected]
Subject: [U2] Sequential Files Question

Unidata 7.1.20
 
I've never dealt with sequential files, but I have a need to output
records to a text file.  Each record will be a series of fixed-length
fields.  Each file will need to be created at the time of opening.  The
destination will be a Windows folder on one of our servers.  I will be
using OPENSEQ to open the file.  However, since each file needs to be
created at time of opening what do I use to create the file?  My reading
of OPENSEQ doesn't indicate that it will create it automatically if it
doesn't exist.
 
Thanks.
 
Al DeWitt
 
 
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to