Comments inline: > When I take the initial WEOFSEQ out, the first run will > produce the result I need. But if I run the program again, > the error statement is returned each time the WRITESEQ > statement is executed. When WEOFSEQ is executed right > after the OPEN... statement, I get the desired result > each time I run it...also, the APPEND is no longer in > the WRITE... statement.
What version of UD are you running? On what OS? We're on an older version of UD (4.0.23) on SCO OpenServer 5.0.5, and we use WRITESEQ a LOT, always with the same basic flow that I posted in my previous message. OPENSEQ, loop through WRITESEQ, WEOFSEQ, CLOSESEQ > Something else I don't understand: > When the file to be created/refreshed doesn't exist in > X.DIR, the error message of the OPEN... statement is > returned. Even so, the new file is created and written > to, and I receive the desired result. I don't get that > one. This happens with or without the PCPERFORM command. If the file doesn't exist, it WILL take the ELSE clause, but with STATUS() = 0. If it can't create and/or open an existing file, it will take the ELSE clause, but with STATUS() <> 0. Use the following in your OPENSEQ statement: OPENSEQ 'dirfile',SEQ.NAME TO FIL.SEQ ELSE IF STATUS() NE 0 THEN PRINT 'Error message...' recover from error... END END If the file doesn't already exist, it will take the else branch, but STATUS() will be zero, so it won't print the error message. Larry Hiscock Western Computer Services http://www.wcs-corp.com -----Original Message----- From: Larry Hiscock [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 13, 2004 12:50 PM To: 'U2 Users Discussion List' Subject: RE: [UD] OPENSEQ, WEOFSEQ, CLOSESEQ If you don't position the file with READSEQ, and you don't use the APPEND clause on WRITESEQ, it should overwrite the file from the beginning. The initial WEOFSEQ should be unnecessary, and in fact is probably why you're only seeing an empty file. We use sequential file processing in a number of programs, including data transfer to/from a webserver, EDI, data export to other applications, etc. -- u2-users mailing list [EMAIL PROTECTED] http://www.oliver.com/mailman/listinfo/u2-users -- u2-users mailing list [EMAIL PROTECTED] http://www.oliver.com/mailman/listinfo/u2-users