Jeff;

I use a VOC pointer for exactly this reason. It doesn't matter which
account/where the directory is - I just need the VOC pointer that points
to it. It makes it really easy to transfer from TEST to LIVE.

Also, as Tim pointed out, you don't need the file to exist to open it.
In fact, I have a bunch of export routines that throw an error if the
file exists when it opens it.

Hth
Colin Alfke
Calgary Canada 

>-----Original Message-----
>From: Jeff Powell
>
>Thank you for all your helpful suggestions.
>
>I am now looking at creating a VOC pointer as Kevin suggests below.
>Actually I'll need to create two pointers one for the "TEST" 
>account and another for the "LIVE" account.
>
>I had originally tried the PATH:FILE syntax before I found out 
>that the file needed to exist before it could be opened. So I 
>went to the other syntax hoping to resolve the non-existant file issue.
>
>Here is the current function without the VOC pointer.
>
>        GOSUB GET.MTR.COUNTER
>        MTR.REC="MTR":OCONV(DATE(),"D2/"):OCONV(MTR.CTR,"MR%4"):".ROW"
>        CONVERT "/" TO "" IN MTR.REC
>        MTR.FILE.PATH='/tmp/MFG.DATA.IPS'
>        IF @PATH = "/ud/TEST" THEN
>                MTR.FILE.PATH=MTR.FILE.PATH:'.TEST'
>        END
>        MTR.FILE.PATH=MTR.FILE.PATH:'/tmp/'
>        OPENSEQ  MTR.FILE.PATH:MTR.REC TO F.MTR.ROW.FILE ELSE
>                EXECUTE '!touch ':MTR.FILE.PATH:MTR.REC
>                OPENSEQ  MTR.FILE.PATH:MTR.REC TO F.MTR.ROW.FILE ELSE 
>                        CALL SB.DISP(3,"TROUBLE OPENING 
>":MTR.FILE.PATH:MTR.REC:" [E":STATUS():"]")
>                        GO PGM.EXIT
>                END
>        END
>        WRITESEQ LASTREC APPEND ON F.MTR.ROW.FILE ELSE 
>                CALL SB.DISP(3,"TROUBLE WRITING TO 
>":MTR.FILE.PATH:MTR.REC" [E":STATUS():"]")
>                GO PGM.EXIT
>        END
>        CLOSESEQ F.MTR.ROW.FILE
>        RETURN
>
>Thanks again.
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to