Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: AIBSDEV

AIBSDEV.m

Go to the documentation of this file.
AIBSDEV ;IBM STATISTICAL RECORD ROUTINES SELECT DEVICE ;[ 02/01/89  9:16 AM ]
 ;1.3; 1/13/89 SET AIBTONL TO "I 1"
 ;1.3; 9/23/88 RESTRUCTURE, ALLOW FOR REGISTRATION ELIGIBILITY FILE
 ;1.1 ;MODIFY FOR USE BY BOTH MSM AND DSM
OUT ;ENTRY POINT FOR "OUTPUT" FILE
 S AIBTXIO=" output ",IN=0 G:AIBOS="M" HFS S AIBDFLT=48
 S (AIBBL,AIBRL)=AIBRLN S:AIBRLN>250 AIBRL=250
 S AIBPARMS="("_"""EFU"""_":"_AIBRL_":"_AIBBL_")" D TAPE^AIBSDEV1 G EXIT
IN ;ENTRY POINT FOR "INPUT" FILE
 S AIBTXIO=" input ",IN=1 G:AIBOS="M" HFS
 S AIBDFLT=47,AIBPARMS="("_"""CALV4"""_":R)" D TAPE^AIBSDEV1 G EXIT
PR ;ENTRY POINT FOR PRINTER
 S AIBDFLT=3 G TERMIO
P0 ;ENTRY POINT FOR "HOME" TERMINAL
 S AIBDFLT=0 G TERMIO
CRT ;ENTRY POINT FOR CUURRENT DEVICE
 S AIBDFLT=$I G TERMIO
TERMIO ;TERMINAL OUTPUT DEVICES SET
 S IN=0,AIBTXIO=" output ",(AIBHL,AIBHH)="" G SELECT
HFS ;HOST FILE SERVER AS DEFAULT
 S AIBDFLT="HFS"
 S AIBHL=51,AIBHH=54,AIBTONL="I 1"
 I $D(AIBFFN) I AIBFFN=2 S AIBDEV=AIBHL G OPENHFS
SELECT ;SELECT DEVICE
 S:'$D(AIBDFLT) AIBDFLT="" W !!,"Enter",AIBTXIO,"device: ",AIBDFLT,"// "
 R AIBDEV:DTIME S:AIBDEV="" AIBDEV=AIBDFLT S:AIBDEV=0 AIBDEV=$I
 I AIBDEV="?" G HELP
 I AIBDEV="^"!(AIBDEV="^Q") S AIBA="A" G QUIT
 I $E(AIBDEV,1,$L(AIBDEV))='$E("HFS",1,$L(AIBDEV)) G CKDEV
 W $E("HFS",$L(AIBDEV)+1,3)," Host File Server" S AIBDEV=AIBHL
CKDEV ;
 I AIBDEV?1N.N!(AIBDEV<223) G SETDEV
 W !,"Device number must be numeric, 0 to 223" G SELECT
SETDEV ;
 I AIBDEV<AIBHL!(AIBDEV>AIBHH) G TERMDEV
 G FILENAME
HELP ;
 W !,"Enter 'HFS' for Host File Server or device #"
 G SELECT
FILENAME ;READ FILENAME
 I $D(AIBFN) I $D(AIBFFN) G OPENHFS
 S:'$D(AIBFN) AIBFN=$S(IN:"/dev/rct",1:"/dev/rmt0")
 W !,"Enter File Name : ",AIBFN,"// "
 R X:DTIME S:X'="" AIBFN=X
 G QUIT:AIBFN="",QUIT:AIBFN="Q^"!(AIBFN="q^") I AIBFN="^" S AIBA="C" G QUIT
 G:AIBFN'="?" OPENHFS
 W !!,?5,"Enter the name of the host oprating system file to "
 W $S(IN:"read from on",1:"write to on"),AIBTXIO
 W !,?5,"the file name should include the fully qualified path name "
 W !,?5,"that identifies the location of the file",! G FILENAME
OPENHFS ;OPEN HOST FILE SERVER FILE
 S:'$D(AIBT2) AIBT2=$S(IN:"R",1:"W") S AIBPARMS="(AIBFN:AIBT2)"
 D OPEN I $T G EXIT
 I AIBDEV=AIBHH G BUSY
 S ZA=$ZA U AIBCDV
 I ZA<0 W !,?5,"Open Failed on Device ",AIBDEV," for file ",AIBFN,*7 G FILENAME
 G EXIT
BUSY ;
 U AIBCDV W !!,"All Host File Server (HFS) devices are busy" G SELECT
TERMDEV ;TERMINAL DEVICES
 G:AIBDEV=$I EXIT
 S AIBT="",AIBT=$O(^%ZIS(1,"C",AIBDEV,AIBT))
 I AIBT="" W !,"device doesn't exist" G SELECT
 S AIBPARMS=":1" D OPEN I $T G EXIT
 E  W !!,"Device busy" G SELECT
 G EXIT
ABEND ;ABNORMAL END OF JOB
 S AIBA="A" G QUIT
OPCANCL ;OPERATOR CANCEL
 S AIBA="C" G QUIT
QUIT ;KILL LOCAL VARIABLES AND QUIT
 K AIBDEV,AIBPARMS S QUIT=1
EXIT ;KILL REMAINING LOCAL VARIABLES AND QUIT
 K AIBRL,AIBBL,AIBPL,AIBPB,AIBDFLT,AIBOF,IN,AIBDR,AIBDEVTB,AIBTXIO,AIBHL,AIBHH,ZA,AIBT
RETURN ;RETURN TO CALLING ROUTINE
 Q
OPEN ;OPEN SELECTED DEVICE/FILE
 I AIBOS="M"!('IN) S AIBOPN="O "_AIBDEV_":"_AIBPARMS_":0" X AIBOPN K AIBOPN Q
 E  S IOP=AIBDEV D ^%ZIS
 G RETURN
CLOSE ;CLOSE SELECTED DEVICE/FILE
 I AIBOS="D" X ^%ZIS("C")
 E  G:'$D(AIBDEV)!($L(AIBDEV)<1) RETURN S AIBCLOSE="C "_AIBDEV X AIBCLOSE K AIBCLOSE
 G RETURN