AZGSAVEP ;IHS/CAO/DAY;SAVE GLOBAL TO DOS MEDIA; [ 11/10/91 4:29 PM ]
;;1.4;AUGS;*0*;OCT 16, 1991
S AUUF="C:\EXPORT"
G:$D(AUMED) NOSELT
ASK R !!,"Copy transaction file to ('^' TO EXIT WITHOUT SAVING)",!!?10,"[D]iskette, or [F]ile F// ",AUMED:DTIME S AUMED=$E(AUMED_"F")
I "^"[AUMED S AUFLG(1)="Job Terminated by Operator at Device Select",AUFLG=-1 G END
G HELP:"?"[AUMED,ASK:"DdFf"'[AUMED
NOSELT S IOP=$I D ^%ZIS K IOP D CURRENT^%ZIS S X=0 X ^%ZOSF("RM")
S IO=AUIO,%DEV=IO D DISK:"Dd"[AUMED D DOS:"Ff"[AUMED
Q
HELP W !!,"This option saves the ' ",AUNAR," ",AUGL,"' transaction file to either a floppy",!,"diskette, or a Dos file on the Hard Disk. The default is to a Dos file",!,"in the ",AUUF," directory."
W !,"Enter either a ""D"" for floppy disk, or an ""F"" for Dos file."
G ASK
DISK ;TRANSFER TX GLOBAL TO FLOPPY DISK
S X="^" U IO(0) W !!,"Insert a FORMATTED Floppy Diskette, 'WRITE ENABLED' ",*7,!,"Press RETURN When Ready or ""^"" to Exit WITHOUT SAVING " R X:DTIME I X["^" S AUFLG(1)="Job Aborted by Operator During Floppy Mount",AUFLG=-1 G END
S AUUF="A:"
DOS ;TRANSFER TX GLOBAL TO DOS FILE.
S X2=$E(DT,1,3)_"0101",X1=DT D ^%DTC S JULDATE=X+1
S PRE=$E(AUGL,2,5),ASUFAC=$P(^AUTTLOC(DUZ(2),0),"^",10),X=""
I '$D(ZTQUEUED) U IO(0) W !!,"DOS File Being Created' ",*7
O IO:(AUUF_"\"_PRE_$E(ASUFAC,3,6)_"."_JULDATE:"W"):0 E S ERRMSG="DOS File" G ERRMESS
U IO(0) W !,"Please Standby - Copying Data to DOS File "_PRE_$E(ASUFAC,3,6)_"."_JULDATE,! D ^AZGSAV1M
G CLOSE
ERRMESS U IO(0) W !,ERRMSG," NOT AVAILABLE" S AUFLG(1)=ERRMSG_" Not Available",AUFLG=-1 G END
CLOSE C:IO'=IO(0) IO
END K PRE,ASUFAC,OUTDATA,INDATA,DEVICE,MESSAGE,IO,ERRMSG,X,Y
Q
AZGSAVEP ;IHS/CAO/DAY;SAVE GLOBAL TO DOS MEDIA; [ 11/10/91 4:29 PM ]
+1 ;;1.4;AUGS;*0*;OCT 16, 1991
+2 SET AUUF="C:\EXPORT"
+3 IF $DATA(AUMED)
GOTO NOSELT
ASK READ !!,"Copy transaction file to ('^' TO EXIT WITHOUT SAVING)",!!?10,"[D]iskette, or [F]ile F// ",AUMED:DTIME
SET AUMED=$EXTRACT(AUMED_"F")
+1 IF "^"[AUMED
SET AUFLG(1)="Job Terminated by Operator at Device Select"
SET AUFLG=-1
GOTO END
+2 IF "?"[AUMED
GOTO HELP
IF "DdFf"'[AUMED
GOTO ASK
NOSELT SET IOP=$IO
DO ^%ZIS
KILL IOP
DO CURRENT^%ZIS
SET X=0
XECUTE ^%ZOSF("RM")
+1 SET IO=AUIO
SET %DEV=IO
IF "Dd"[AUMED
DO DISK
IF "Ff"[AUMED
DO DOS
+2 QUIT
HELP WRITE !!,"This option saves the ' ",AUNAR," ",AUGL,"' transaction file to either a floppy",!,"diskette, or a Dos file on the Hard Disk. The default is to a Dos file",!,"in the ",AUUF," directory."
+1 WRITE !,"Enter either a ""D"" for floppy disk, or an ""F"" for Dos file."
+2 GOTO ASK
DISK ;TRANSFER TX GLOBAL TO FLOPPY DISK
+1 SET X="^"
USE IO(0)
WRITE !!,"Insert a FORMATTED Floppy Diskette, 'WRITE ENABLED' ",*7,!,"Press RETURN When Ready or ""^"" to Exit WITHOUT SAVING "
READ X:DTIME
IF X["^"
SET AUFLG(1)="Job Aborted by Operator During Floppy Mount"
SET AUFLG=-1
GOTO END
+2 SET AUUF="A:"
DOS ;TRANSFER TX GLOBAL TO DOS FILE.
+1 SET X2=$EXTRACT(DT,1,3)_"0101"
SET X1=DT
DO ^%DTC
SET JULDATE=X+1
+2 SET PRE=$EXTRACT(AUGL,2,5)
SET ASUFAC=$PIECE(^AUTTLOC(DUZ(2),0),"^",10)
SET X=""
+3 IF '$DATA(ZTQUEUED)
USE IO(0)
WRITE !!,"DOS File Being Created' ",*7
+4 OPEN IO:(AUUF_"\"_PRE_$EXTRACT(ASUFAC,3,6)_"."_JULDATE:"W"):0
IF '$TEST
SET ERRMSG="DOS File"
GOTO ERRMESS
+5 USE IO(0)
WRITE !,"Please Standby - Copying Data to DOS File "_PRE_$EXTRACT(ASUFAC,3,6)_"."_JULDATE,!
DO ^AZGSAV1M
+6 GOTO CLOSE
ERRMESS USE IO(0)
WRITE !,ERRMSG," NOT AVAILABLE"
SET AUFLG(1)=ERRMSG_" Not Available"
SET AUFLG=-1
GOTO END
CLOSE IF IO'=IO(0)
CLOSE IO
END KILL PRE,ASUFAC,OUTDATA,INDATA,DEVICE,MESSAGE,IO,ERRMSG,X,Y
+1 QUIT