One thing I do regularly is to execute sh - c "rm filename; touch filename" then open and write to the file.
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ron Moore Sent: Tuesday, August 24, 2004 1:31 PM To: [EMAIL PROTECTED] Subject: RE: [U2] Clearing a Sequential File: Thanks for the idea, Kevin. I'll keep that in mind for future work. Unfortunately, I can't live with the blank line. Some specs get 'set in stone' early in the project. Ron -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kevin King Sent: Tuesday, August 24, 2004 2:26 PM To: [EMAIL PROTECTED] Subject: RE: [U2] Clearing a Sequential File: There are a number of approaches to this. If you're on a *nix platform, you could rm and touch the file you want and that'll create the null file. On Windows you can do a similar thing, but of course the OS verbs are different. I use a cross-platform approach that doesn't use OS verbs at all. First, open the directory file as a regular file. Use DELETE to remove the old item. Then, when writing to the file, on the first output just WRITE it to the DIR file under the sequential name. Then open the sequential item and WRITESEQ to it thereafter. This is a bit more complicated than other approaches, but if you WRITE '' ON dirfile,name at the start (which is the most common variant of the technique) you'll get a blank first line. If you don't mind that blank first line, then that may be an easier way to go. -Kevin [EMAIL PROTECTED] http://www.PrecisOnline.com -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ron Moore Sent: Tuesday, August 24, 2004 11:41 AM To: [EMAIL PROTECTED] Subject: [U2] Clearing a Sequential File: I am able to OPENSEQ and WRITESEQ for a sequential file, and need to clear the records or data before writing to this file. I have tried CLEAR and CLEARFILE, but may not have the correct syntax. How do I go about this? TIA, as always. Ron ------- 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/
