PIPTRN M0003, TRUNCATE COMMAND 	MACRO M1110  22-AUG-78 01:36

TABLE OF CONTENTS



     7-    1	**** PIPTRN VERSION M0003 ****

PIPTRN M0003, TRUNCATE COMMAND 	MACRO M1110  22-AUG-78 01:36  PAGE 7





      1						.TITLE	PIPTRN M0003, TRUNCATE COMMAND - PIP

						.SBTTL	**** PIPTRN VERSION M0003 ****

						.IDENT	/M0003/

      2					; ALTERED:

      3					; ANDREW C. GOLDSTEIN  23 FEB 76  13:17

      4					;

      5					;

      6					; B. SCHREIBER	27-AUG-77

      7					;

      8					;	BLS025 -- ADD EXIT WITH STATUS

      9					;

     10					; B. SCHREIBER	7-JUN-78

     11					;

     12					;	BLS052 -- INTEGRATE ODS-2 CHANGES FROM A. GOLDSTEIN AND E.

     13					;		MARISON.

     14					;

     15					; COPYRIGHT (C) 1978, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.

     16					; COPYRIGHT (C) 1977, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.

     17					; COPYRIGHT 1975, DIGITAL EQUIPMENT CORP., MAYNARD MASS.

     18					; COPYRIGHT 1974, DIGITAL EQUIPMENT CORP., MAYNARD MASS.

     19

     20					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE

     21					; ON A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION

     22					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT

     23					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.

     24

     25					; THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT

     26					; NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL

     27					; EQUIPMENT CORPORATION.

     28

     29					; DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY

     30					; OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

     31					;

     32					; PETER H. LIPMAN	2-MAY-74

     33

     34						.IF	GT,R$$11M

     35						.MACRO	OPEN$	A1,A2,A3,A4,A5,A6,A7,A8,A9

     36						.MCALL	OFNB$

     37						OFNB$	A1,A2,A3,A4,A5,A6,A7,A8,A9

     38						.ENDM	OPEN$

     39						.ENDC

     40					;

     41						.MCALL	FDOF$L,FCSBT$

     42	000000					FDOF$L			;DEFINE THE FDB OFFSETS LOCALLY

     43	000000					FCSBT$			;DEFINE THE FDB BITS AND VALUES LOCALLY

     44					;

     45						.MCALL	CALL,RETURN,FDRC$R

     46						.MCALL	OPEN$U,PRINT$,CLOSE$

     47

     48	000000					PURE.I

     49

     50					; TRUNCATE THE SPECIFIED LIST OF FILES

     51	000000				TRUNC::	CALL	FSTOUT

     52	000004					FDRC$R	#FDBOUT,#FD.RWM

     53	000016	052767 	000000G	000000G	TRUNC1:	BIS	#FRSTIM,CPYCTL

     54	000024					CALL	PARSE

     55	000030	103430 				BCS	60$

PIPTRN M0003, TRUNCATE COMMAND 	MACRO M1110  22-AUG-78 01:36  PAGE 7-1

**** PIPTRN VERSION M0003 ****



     56	000032	016067 	000120 	000000G		MOV	F.FVER(R0),VERSAV

     57	000040				10$:										;BLS052

     58						.IF NDF	O$$DS2								;BLS052

     59						MOV	VERSAV,F.FVER(R0)						;BLS052

     60						.ENDC									;BLS052

     61	000040					CALL	FNDNXT								;**-1

     62	000044	103425 				BCS	68$

     63	000046	042767 	000000G	000000G		BIC	#FRSTIM,CPYCTL

     64	000054					OPEN$U	R0		;OPEN THE FILE

     65	000066	103417 				BCS	70$

     66					;

     67					; TRUNCATE AND CLOSE THE FILE

     68					;

     69	000070					CALL	.TRNCL

     70	000074	103424 				BCS	75$

     71	000076				20$:	CLOSE$	R0		;CERTAIN CONDITIONS WILL LEAVE IT OPEN

     72	000102					CALL	NXTFIL		;ANY MORE FILES IN THIS FILE SPEC?

     73	000106	103423 				BCS	TRNNXT		;BRANCH IF NO

     74	000110	000753 				BR	10$		;GO FIND THE NEXT FILE

     75					;

     76					; PARSE ERROR

     77	000112				60$:	CALL	PRSERR

     78	000116	000417 				BR	TRNNXT

     79					;

     80					; FAILED TO FIND FILE

     81	000120				68$:	CALL	FNDERR

     82	000124	000414 				BR	TRNNXT

     83					;

     84					; OPEN FAILURE

     85	000126				70$:	ERROUT	OP01,0,0

	000126	104426 				TRAP	X

	000130	000000G				.WORD	OP01SZ

	000132	000000G				.WORD	OP01MG

     86	000134	012700 	000000G			MOV	#FDBOUT,R0

     87	000140				77$:	CALL	SETWAR		;SET WARNING STATUS

     88	000144	000754 				BR	20$		;CONTINUE

     89					;

     90					; ERROR FROM TRUNCATE

     91	000146				75$:	ERROUT	TR01,0

	000146	104406 				TRAP	X

	000150	000000G				.WORD	TR01SZ

	000152	000000G				.WORD	TR01MG

     92	000154	000771 				BR	77$		;GO SET WARNING STATUS

     93					;

     94					; GO GET THE NEXT FILE IN THE LIST TO BE TRUNCATED

     95	000156				TRNNXT:	CALL	NXTOUT

     96	000162	103402 				BCS	10$

     97	000164	000167 	177626 			JMP	TRUNC1

     98	000170	000167 	000000G		10$:	JMP	CLOSX

     99

    100					;

    101					;

    102		000001 				.END

PIPTRN M0003, TRUNCATE COMMAND 	MACRO M1110  22-AUG-78 01:36  PAGE 7-2

SYMBOL TABLE



AB.CDT  000105   	FD.DIR= 000010   	F.BBFS= 000062   	F.RCTL= 000017   	OP01SZ= ****** GX

AB.CHU  000064   	FD.FTN= 000001   	F.BDB = 000070   	F.RSIZ= 000002   	O$$DS2= 000001

AB.EXP  000122   	FD.F11= 040000   	F.BGBC= 000057   	F.RTYP= 000000   	PARSE = ****** GX

AB.FNU  000000   	FD.INS= 000010   	F.BKDN= 000026   	F.SEQN= 000100   	PAR$$$= 000000

AB.FP   000062   	FD.ISP= 002000   	F.BKDS= 000020   	F.SPDV= 000072   	PRSERR= ****** GX

AB.FSQ  000002   	FD.MNT= 100000   	F.BKEF= 000050   	F.SPUN= 000074   	R$$DPB= 000001

AB.GC   000061   	FD.OSP= 004000   	F.BKP1= 000051   	F.STBK= 000036   	R$$DYM= 000001

AB.NAM  000006   	FD.PLC= 000004   	F.BKST= 000024   	F.UNIT= 000136   	R$$EIS= 000000

AB.PC   000060   	FD.PRN= 000004   	F.BKVB= 000064   	F.URBD= 000020   	R$$VMS= 000001

AB.RDT  000070   	FD.PSE= 010000   	F.CHR = 000075   	F.VBN = 000064   	R$$11M= 000001

AB.REV  000066   	FD.RAH= 000001   	F.CNTG= 000034   	F.VBSZ= 000060   	R.FIX = 000001

AB.UAT  000020   	FD.RAN= 000002   	F.DFNB= 000046   	NB.DEV= 000200   	R.SEQ = 000003

CH.AND= 000001   	FD.REC= 000001   	F.DSPT= 000044   	NB.DIR= 000100   	R.VAR = 000002

CLOSX = ****** GX	FD.RWM= 000001   	F.DVNM= 000134   	NB.NAM= 000004   	SETWAR= ****** GX

CPYCTL= ****** GX	FD.SDI= 000020   	F.EFBK= 000010   	NB.NXD= 020000   	S.FATT= 000016

FA.APD= 000100   	FD.SQD= 000040   	F.EFN = 000050   	NB.SD1= 000400   	S.FDB = 000140

FA.CRE= 000010   	FD.TTY= 000004   	F.EOBB= 000032   	NB.SD2= 001000   	S.FNAM= 000006

FA.DLK= 001000   	FD.WBH= 000002   	F.ERR = 000052   	NB.SNM= 000040   	S.FNB = 000036

FA.ENB= 100000   	FF.CHR= 000005   	F.FACC= 000043   	NB.STP= 000020   	S.FNBW= 000017

FA.EXC= 002000   	FF.NV = 000003   	F.FFBY= 000014   	NB.SVR= 000010   	S.FNTY= 000004

FA.EXT= 000004   	FF.POE= 000002   	F.FNAM= 000110   	NB.TYP= 000002   	S.FTYP= 000002

FA.NSP= 000100   	FF.RWD= 000001   	F.FNB = 000102   	NB.VER= 000001   	S.NFEN= 000020

FA.POS= 010000   	FF.RWF= 000006   	F.FTYP= 000116   	NB.WLV= 010000   	TRNNXT  000156R     002

FA.RD = 000001   	FF.SPC= 000004   	F.FVER= 000120   	NXTFIL= ****** GX	TRUNC   000000RG    002

FA.RWD= 004000   	FNDERR= ****** GX	F.HIBK= 000004   	NXTOUT= ****** GX	TRUNC1  000016R     002

FA.SEQ= 040000   	FNDNXT= ****** GX	F.LUN = 000042   	N.DID = 000024   	TR01MG= ****** GX

FA.SHR= 000040   	FO.APD= 000106   	F.MBCT= 000054   	N.DVNM= 000032   	TR01SZ= ****** GX

FA.TMP= 000020   	FO.MFY= 000002   	F.MBC1= 000055   	N.FID = 000000   	VERSAV= ****** GX

FA.WCK= 020000   	FO.RD = 000001   	F.MBFG= 000056   	N.FNAM= 000006   	X     = 000006

FA.WRT= 000002   	FO.UPD= 000006   	F.NRBD= 000024   	N.FTYP= 000014   	.CLOSE= ****** G

FDBOUT= ****** GX	FO.WRT= 000016   	F.NREC= 000030   	N.FVER= 000016   	.OPFNB= ****** G

FD.BLK= 000010   	FRSTIM= ****** GX	F.OVBS= 000030   	N.NEXT= 000022   	.TRNCL= ****** GX

FD.CCL= 000002   	FSTOUT= ****** GX	F.RACC= 000016   	N.STAT= 000020   	...GBL= 000000

FD.COM= 020000   	F.ACTL= 000076   	F.RATT= 000001   	N.UNIT= 000034   	...TPC= 000140

FD.CR = 000002   	F.ALOC= 000040   	F.RCNM= 000034   	OP01MG= ****** GX



. ABS.	000131	   000

      	000000	   001

PURE$I	000174	   002

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  5136 WORDS  ( 21 PAGES)

DYNAMIC MEMORY:  5940 WORDS  ( 22 PAGES)

ELAPSED TIME:  00:00:21

OBJ$:PIPTRN,LIS$:PIPTRN/-SP=SRC$:PIPMAC,PIPTRN

