		USRLIB - User Subroutine Library
		================================

 USRLIB is a subroutine containing many subroutines of interest to the
 general user.  They are divided into the following categories:-

	CONVERSION   - ASCII to binary conversions & suchlike
	DATE & TIME  - Conversion/retrieval of date and time
	STRING       - Limited string manipulation macros
        SPECIAL	     - Odd special subroutines

 For a list of routines in a particular category type HELP USRLIB <category>
 For help on a particular routine type HELP USRLIB <routine>
2	CONVERSION
 The following conversion routines are held in USRLIB:-

 ASCBIN	- Convert number from ASCII to binary
 ASCEBC	- Convert string from ASCII to EBCDIC
 ASCFNM	- Convert ASCII filespecification to filename block
 ASCRAD	- Convert ASCII string to RAD50
 BINASC	- Convert number from binary to ASCII
 CNVTUC	- Convert ASCII string to Upper Case
 EBCASC	- Convert string from EBCDIC to ASCII
 FNMASC	- Convert filename block to ASCII filespecification
 RADASC	- Convert RAD50 string to ASCII

 For help on a particular routine type HELP USRLIB <routine>
2	DATE
	#TIME
2	TIME
 The  suite  of date/time routines consists of several modules in four
 basic forms:-

	CDATxy - Convert a date from type x to type y
	CTIMxy - Convert a time from type x to type y
	GTDATx - Get today's date as type x
	GTTIMx - Get current time as type x

 For dates the valid types are:-

 I	- Day, Month & Year since 1950 as 3 byte values
 A	- ASCII DD-MMM-YY
 D	- Integer*2 days since 1st January 1950
 E	- Integer*2 encoded date (yyyyyyymmmmddddd)
 W	- Weekday Number (0 = Sunday)

 For times the valid types are:-

 I	- Hours, Minutes, Seconds & Tenths of a Second
 A	- ASCII HH:MM:SS.S
 D	- Integer*4 seconds since midnight

 For help on a particular routine type HELP USRLIB <routine>
2	STRING
 The following String Manipulation routines are defined in USRLIB:-

 STDELE	- Delete substring from string
 STEXCH	- Exchange characters in a string
 STFILL	- Initialize string with given character
 STFIND	- Find substring in string
 STINSE	- Insert substring into string
 STJUST	- Justify string left or right
 STLOCA	- Locate one of set of characters in string
 STRCMP	- Compare two strings
 STREPL	- Replace occurrences of one character by another

 For help on a particular routine type HELP USRLIB <routine>
2	SPECIALS

 The following special routines exist in USRLIB:-

 DMUL	- Double precision multiply from MACRO-11
 FDBRTN	- File manipulation from FORTRAN
 I4CMP	- Compare two doubleword numbers
 PRMCHK	- Generalised parameter checking
 RANDM	- Generate a random number
 SORT	- Generalised sort routine5

 For help on a particular routine type HELP USRLIB <routine>
2	ASCBIN

 This  module converts a numeric ASCII stringin any radix from 2 to 36
 into a binary (doubleword) number

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	ASCBIN (NUMCHR,ASCSTR,RADIX,NUMBER [,STATUS])
 or
	STATUS = ASCBIN (NUMCHR,ASCSTR,RADIX,NUMBER)

	Where:
		NUMCHR = Number of ASCII characters to convert
		RADIX  = Radix in which the number is held (2-36)
		ASCSTR = Address of input ASCII string
		NUMBER = Output Doubleword Number
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = -2 if the converted value overflowed a doubleword
               = number  of  characters not converted if a non-numeric
                 (in the sense of the radix) character was encountered
2	ASCEBC

 This subroutine converts an ASCII stringg into EBCDIC

	This subroutine is called via the standard FORTRAN interface as:-

	CALL	ASCEBC (ASCSTR,EBCSTR,NUMCHR [,STATUS])
 or
	STATUS = ASCEBC (ASCSTR,EBCSTR,NUMCHR)

	Where:-
		ASCSTR = Address of input ASCII string
		EBCSTR = Address of output EBCDIC string
		NUMCHR = Number of characters in the string
		STATUS = Optional error return

 Errors Returned:

	STATUS =  0 if the operation was successful
	       = -1 if a parameter error was detected
2	ASCFNM

 This  module  parses an ASCII filename, and enters the details into a
 filename block.

	This subroutine is called via the standard FORTRAN callin sequence as:

	CALL    ASCFNM(STRING,LENGTH,BLOCK,UIC [,STATUS])
 or
	STATUS = ASCFNM(STRING,LENGTH,BLOCK,UIC)

	Where:-
		STRING = THE ADDRESS OF THE INPUT STRING
		LENGTH = THE LENGTH OF THE INPUT STRING
		BLOCK  = THE RSX FILENAME BLOCK
		UIC    = A WORD TO HOLD THE UIC
		STATUS = AN OPTIONAL ERROR RETURN

           NOTE THAT THE PARTS OF BLOCK & UIC WHICH ARE NOT SPECIFIED
                 IN THE STRING ARE LEFT UNCHANGED.
 Errors Returned:

	STATUS = 0 if the operation was successful
	       = -1 if there was a parameter error
	       = +1 if there was a specification error

2	ASCRAD

 This module converts an ASCII string to RAD50

	This subroutine is called via the standard FORTRAN calling sequence as:-

	CALL	ASCRAD(ACOUNT,ASCSTR,RADSTR [,STATUS])
 or
	STATUS = ASCRAD(ACOUNT,ASCSTR,RADSTR)

	Where:
		ACOUNT = Number of ASCII characters to translate
		ASCSTR = Address of the input ASCII string
		RADSTR = Address of the output RAD50 array
		STATUS = an optional flag on input
				0 => period is a terminator (default)
				1 => period is a valid RAD50 character
		       = an optional error return on output

 Errors Returned:

	STATUS = 0 if the operation was successfully
	       = -1 if there was a parameter error
	       = number of characters not converted if a non-RAD50 character
		 was detected

2	BINASC

 This module converts a binary number to ASCII in any radix from 2 to 36

	This subroutine is called via the standard FORTRAN calling sequence as:-

	CALL	BINASC (NUMBER,NUMCHR,RADIX,ASCSTR [,STATUS])
 or
	STATUS = BINASC (NUMBER,NUMCHR,RADIX,ASCSTR)

	WHERE:
		NUMBER = THE (DOUBLEWORD) NUMBER TO BE CONVERTED
		NUMCHR = THE NUMBER OF OUTPUT CHARACTERS IN THE RANGE 0-255
		RADIX  = THE RADIX FOR THE CONVERSION (2-36)
		ASCSTR = THE ADDRESS OF THE OUTPUT STRING
		STATUS, IF SPECIFIED, DETERMINES THE MODE OF CONVERSION ON INPUT
		  IF BIT 0 SET THEN SIGNED CONVERSION, ELSE UNSIGNED
		  IF BIT 1 SET THEN LEADING ZEROES, ELSE LEADING BLANKS
		  IF BIT 2 SET THEN LEFT ADJUSTED, ELSE RIGHT ADJUSTED
			And is the error return on output

 Errors Returned:

	STATUS = 0 IF THE OPERATION WAS SUCCESSFUL
	       = -1 IF THERE WAS A PARAMETER ERROR
	       = +1 IF THE NUMBER WOULD NOT FIT IN THE OUTPUT FIELD

2	CNVTUC

 This module converts all lower-case characters in a string into upper-case.

	This subroutine is called via the standard FORTRAN calling sequence as:-

	CALL CNVTUC (NUMCHR,ASCSTR [,STATUS])
 or
	STATUS = CNVTUC (NUMCHR,ASCSTR)

	Where:-
		NUMCHR = Number of Characters to be converted (0-255)
		ASCSTR = Address of Strin to be converted.
		STATUS = Optional Error Return

 Errors Returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
2	DMUL

 This module multiplies a positive double-precision number by a single-
 precision multiplier, checking for overflow during the operation.

	This module is only callable from MACRO-11 as:

	CALL	DMUL

	Where:
		R0, on input  = High-order word of Multiplicand
		R1, on input  = Low-order word of Multiplicand
		R2, on input  = Multiplier
		R0, on output = High-order word of result
		R1, on output = Low-order word of result
		R2, on output is unchanged

 Errors returned:

	C-bit is clear if the operation was successful
	C-bit is set if the result overflowed a doubleword
2	EBCASC

 This subroutine converts an EBCDIC stringg into ASCII

	This subroutine is called via the standard FORTRAN interface as:-

	CALL	EBCASC (EBCSTR,ASCSTR,NUMCHR [,STATUS])
 or
	STATUS = EBCASC (EBCSTR,ASCSTR,NUMCHR)

	Where:-
		EBCSTR = Address of input EBCDIC string
		ASCSTR = Address of output ASCII string
		NUMCHR = Number of characters in the string
		STATUS = Optional error return

 Errors Returned:

	STATUS =  0 if the operation was successful
	       = -1 if a parameter error was detected
2	FDBRTN

 This module performs various functions on an FDB usually impossible
 from inside a FORTRAN task.

 These subroutines are called via the standard FORTRAN calling sequence as:

	CALL	FDBCR(LUN)	To set FD.CR bit in FDB
	CALL	FDBBLK(LUN)	To set FD.BLK bit in FDB
	CALL	FDBDEL(LUN,ERR) To delete file open on FDB

	Where:
		LUN	= Logical Unit on which the file is open
		ERR	= FCS Error Return (where applicable)

 Errors returned:

	For FDBDEL the FCS error return from the Delete is returned
2	FNMASC

 This module converts a filename in an RSX filename block into an ASCII string

	This subroutine is called via the standard FORTRAN callingg sequence as:

	CALL  FNMASC(BLOCK,UIC,STRING [,ERROR])
 or
	STATUS =  FNMASC(BLOCK,UIC,STRING)

	Where:-
		BLOCK  = THE RSX FILENAME BLOCK
		UIC    = THE FILE UIC
		STRING = THE ADDRESS OF THE OUTPUT STRING
		ERROR  = AN OPTIONAL ERROR RETURN
 Errors Returned:

	STATUS = 0 if the operation was successful
	       = -1 if there was a parameter error
2	I4CMP

 This module allows a FORTRAN or MACRO program to compare two
 doubleword (INTEGER*4) signed integers.

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	I4CMP	(NUM1,NUM2 [,STATUS])
 or
	STATUS = I4CMP	(NUM1,NUM2)

	Where:
		NUM1	= Address of First Doubleword
		NUM2	= Address of Second Doubleword
		STATUS = Optional error return

 Errors returned:

	STATUS = 1 if the first number was less than the second
		 2 if the first number equalled the second
		 3 if the first number was greater than the second
	       = -1 if a parameter error was detected
2	PRMCHK

 This is a generalised parameter checking co-routine designed to be
 called by macro subroutines called with parameters.

 The  subroutine  assumes  that  all  the subroutines that call it are
 themselves called with a number of parameters of which the last is an
 optional error return.
 The  calling  suboutine  should put the number of expected parameters
 (including the error parameter) in R0, leave R5 unchanged and do a
		CALL	PRMCHK
 PRMCHK will return with one of the three following cases:-
	i)   C-bit clear, R0 = address of error return
		This implies that all expected parameters were specified
	ii)  C-bit clear, R0 = 0
		This implies that all expected parameters except the error
		return were specified
	iii) C-bit set, R0 = -1
		This implies an invalid number of parameters were specified.
 In addition, when the calling subroutine exits control is returned to
 PRMCHK  which  expects  an error/success value to be stored in R0. It
 then stores this value in the error return parameter (if specified).
 Note that:-
	i)   If an invalid number of parameters is specified the last
	     parameter is assumed to be an error parameter.
	ii)  The error parameter is assumed to be a word if word-aligned
	     and a byte otherwise.
	iii) PRMCHK saves all registers,thus avoiding the need for each
	     subroutine to do so.
2	RADASC

 This module converts a RAD50 string to ASCII.

	This subroutine is called via the standard FORTRAN callin sequence as:-

	CALL RADASC(RCOUNT,RADSTR,ASCSTR [,STATUS])
 or
	STATUS = RADASC(RCOUNT,RADSTR,ASCSTR)

	Where:-
		RCOUNT = Number of RAD50 words to convert
		RADSTR = Address of RAD50 string
		ASCSTR = Address of output ASCII string
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was completed successfully
	       = -1 if there was a parameter error
2	RANDM

 This routine returns a random number
 
 This subroutine is called via the standard FORTRAN calling sequence as:-

	CALL	RANDM	(IWORK,IRANGE,IRAN)

	Where:-
		IWORK	= one word work area (initially zero)
		IRANGE	= range for random number
		IRAN	= returned random number
2	SORT

 This module will sort an array of items by some specified key.
 Note that the order of items with the same key is not altered so that
 this routine may be called repeatedly to emulate a sort by multiple keys.

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	SORT(IDIR,ITYP,IKLN,IOFF,IFLN,ARRAY,INUM [,STATUS])
 or
	STATUS = SORT(IDIR,ITYP,IKLN,IOFF,IFLN,ARRAY,INUM)

	Where:
		IDIR 	= Direction of Sort
			= 0 for Ascending, 1 for Descending
		ITYP	= Type of element to sort
			= 0 for String element
			= +1 for signed byte, -1 for unsigned byte
			= +2 for signed word, -2 for unsigned word
			= +3 for signed doubleword, -3 for unsigned doubleword
			= +4 for signed single-precision floating-point
			= +5 for signed double-precision floating-point
		IKLN	= Length of key in bytes (type 0 only)
		IOFF	= Offset of key in array element (from 1)
		IFLN	= Total size of field element in array
		ARRAY	= Start address of array to sort
		INUM	= Number of elements in the array
		STATUS = Optional error return

	All fields are assumed to be LOGICAL*1 except INUM which is INTEGER*2

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
2	STDELE

 This module removes a substring from within an ASCII string

	This subroutine is called via the standard FORTRAN calling sequence as:-

	CALL STDELE(STADDR,DELLEN,RSTLEN [,STATUS])
 or
	STATUS = STDELE(STADDR,DELLEN,RSTLEN)

	Where:-
		STADDR = Start address of section to be deleted
		DELLEN = Number of bytes to be deleted (0-255)
		RSTLEN = Lenth of strin after section to be deleted (0-255)
		STATUS = Optional error return

 Errors Returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
2	STEXCH

 This subroutine changes all or some occurrences within an ASCII string
 of one substring for another, extending or truncating (and padding with
 nulls) the strin if the substrings are of different length

	This subroutine is called via the standard FORTRAN  calling sequence as:-

	CALL	STEXCH(SUB1,SLEN1,SUB2,SLEN2,STR,LEN,REPCNT [,STATUS])
 or
	STATUS = STEXCH(SUB1,SLEN1,SUB2,SLEN2,STR,LEN,REPCNT)

	Where:-
		SUB1   = Address of substring to be replaced
		LEN1   = Length of substring to be replaced
		SUB2   = Address of substring to replace SUB1 with
		LEN2   = Length of substring to replace SUB1 with
		STR    = Address of string for replacement to be done in
		LEN    = Length of string for replacement to be done in
		REPCNT = Number of occurrences to be replaced (0=all)
		STATUS = Optional error reply

 Errors Returned:

	STATUS = 0 if the operation was successful
              = -1 if a parameter error was detected
2	STFILL

 This module initialises a string to a particular character

	This subroutine is called via the standard FORTRAN calling sequence as:-

	CALL	STFILL(ASCSTR,ILEN,CHAR [,STATUS])
 or
	STATUS = STFILL(ASCSTR,ILEN,CHAR)

	Where:-
		ASCSTR = Address of the strin to be initialised
		ILEN   = Length of the string to be initialised
		CHAR   = Character to initialise with
		STATUS = Optional error return

 Errors Returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
2	STFIND

 This module searches one ASCII string for another ASCII string

	This subroutine is called via the standard FORTRAN calling sequence as:-

	CALL STFIND (SEASTR,SEALEN,DEASTR,DEALEN,IADDR [,STATUS])
 or
	STATUS =  STFIND (SEASTR,SEALEN,DEASTR,DEALEN,IADDR)

	Where:-
		SEASTR = Address of pattern to be searched for
		SEALEN = Length of pattern to be searched for
		DEASTR = Address of pattern to be searched
		DEALEN = Length of pattern to be searched
		IADDR  = Position of first match located
		STATUS = Optional error return

 Errors Returned:

	STATUS = 0 if the string was found successfully
	       = +1 if the string was not found
	       = -1 if there was a parameter error
2	STINSE

 This routine inserts one ASCII string before another one

	This subroutine is called via the standard FORTRAN callin sequence as:-

	CALL	STINSE(INSSTR,INSLEN,DESSTR,DESLEN [,STATUS])
 or
	STATUS = STINSE(INSSTR,INSLEN,DESSTR,DESLEN)

	Where:-
		INSSTR = Address of the string to be inserted
		INSLEN = Length of string to be inserted
		DESSTR = Address at which string is to be inserted
		DESLEN = Length of original string after insertion point
		STATUS = Optional error return

 Errors Returned:
	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
2	STJUST

 This subroutine justifies an ASCII string either to the right or to the left

	This subroutine is called via the standard FORTRAN calling sequence as:-

	CALL	STJUST(ASCSTR,STRLEN,JUST [,STATUS])
 or
	STATUS = STJUST(ASCSTR,STRLEN,JUST)

	Where:-
		ASCSTR = Address of ASCII string to be justified
		STRLEN = Lenth of string to be justified
		JUST   = Direction of justification (-ve = left, +ve = right)
		STATUS = Optional error return

 Errors Returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
2	STLOCA

 This subroutine locates the first occurrence of any one of a given
 string of ASCII characters in an ASCII string

	This subroutine is called via the standard FORTRAN calling sequence as:-

	CALL	STLOCA (SEASTR,SEALEN,ASCSTR,ASCLEN,POS [,STATUS])
 or
	STATUS = STLOCA (SEASTR,SEALEN,ASCSTR,ASCLEN,POS)

	Where:-
		SEASTR = Address of string holded characters to be searched for
		SEALEN = Length of string holding caharcters to be searched for
		ASCSTR = Address of string to be searched
		ASCLEN = Length of string to be searched
		POS    = Output position of first char found (0=none found)
		STATUS = Optional error return

 Errors Returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = +1 if none of the characters could be found
2	STRCMP

 This module compares two ASCII strings and returns the offset of
 the first byte that is different.

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	STRCMP	(STR1,STR2,LEN [,STATUS])
 or
	STATUS = STRCMP	(STR1,STR2,LEN)

	Where:
		STR1	= Address of first string
		STR2	= Address of second string
		LEN	= Length to be compared
		STATUS	= Optional error return

 Errors returned:

	STATUS = 0 if the comparison was successful
	       = -1 if a parameter error was detected
		= offset of first byte that is different (1-LEN)
2	STREPL

 This routine replaces the contents of one string with another

	This subroutine is called via the standard FORTRAN calling sequence as:-

	CALL	STREPL	(STR1,STR2,LEN [,STATUS])
 or
	STATUS = STREPL	(STR1,STR2,LEN)

	Where:-
		STR1   = String to use for overwriting
		STR2   = String to be overwritten
		LEN    = Length of string
		STATUS = Optional Error Return

 Errors Returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
2	CDATAD

 This module converts a date in ASCII to a number of days since 1950

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	CDATAD (DATE,DAYNO [,STATUS])
 or
	STATUS = CDATAD (DATE,DAYNO)
 or
	CALL	CDATAD from MACRO-11 (with R5=0)

	Where:
		DAYNO	= Number of days since 1/1/50 (1/1/50 = 1)
			  (R1 for MACRO calls)
		DATE	= ASCII date in form DD-MMM-YY 
			  (address in R1 for input,R4 for output for MACRO calls)
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = -2 if an invalid input date was specified
2	CDATAE

 This module converts a date from ASCII to an encoded form
Calling Sequence:

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	CDATAE (DATE,ENCDAT [,STATUS])
 or
	STATUS = CDATAE (DATE,ENCDAT)
 or
	CALL	CDATAE from MACRO-11 (with R5=0)

	Where:
		DATE	= ASCII date in form DD-MMM-YY 
			  (address in R1 for input,R4 for output for MACRO calls)
		ENCDAT	= Binary encoded date (R1 for MACRO calls)
			  <16 bits in the form yyyyyyymmmmddddd>
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = -2 if an invalid input date was specified
2	CDATAI

 This module converts a date from ASCII to 3 integers

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	CDATAI (DATE,DAY,MONTH,YEAR [,STATUS])
 or
	STATUS = CDATAI (DATE,DAY,MONTH,YEAR)

 or
	CALL	CDATAI from MACRO-11 with
		R5 = 0
		R1 = Address of DATE
		R1 = DAY on output
		R2 = MONTH on output
		R3 = YEAR on output
		R0 = STATUS on output

	Where:
		DAY	= Number of day (1-31)
		MONTH	= Number of month (1-12)
		YEAR	= Year since 1950 (1950=0)
		DATE	= ASCII Date in form DD-MMM-YY
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = -2 if an invalid input date was specified
2	CDATAW
 This module converts a date from ASCII to a weekday number

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	CDATAW (DATE,WEKDAY [,STATUS])
 or
	STATUS = CDATAW (DATE,WEKDAY)
 or
	CALL	CDATAW from MACRO-11 (with R5=0)

	Where:
		DATE	= ASCII date in form DD-MMM-YY 
			  (address in R1 for input,R4 for output for MACRO calls)
		WEKDAY	= Weekday Number (Sunday=0) (R1 for MACRO calls)
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = -2 if an invalid input date was specified
2	CDATDA

 This module converts a date from a number of days since 1950 to ASCII

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	CDATDA (DAYNO,DATE [,STATUS])
 or
	STATUS = CDATDA (DAYNO,DATE)
 or
	CALL	CDATDA from MACRO-11 (with R5=0)

	Where:
		DAYNO	= Number of days since 1/1/50 (1/1/50 = 1)
			  (R1 for MACRO calls)
		DATE	= ASCII date in form DD-MMM-YY 
			  (address in R1 for input,R4 for output for MACRO calls)
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = -2 if an invalid input date was specified
2	CDATDE

 This  module  converts  a date from a number of days since 1950 to an
 encoded form.

 This subbroutine is called via the standard FORTRAN calling sequence as:

	CALL	CDATDE (DAYNO,ENCDAT [,STATUS])
 or
	STATUS = CDATDE (DAYNO,ENCDAT)
 or
	CALL	CDATDE from MACRO-11 (with R5=0)

	Where:
		DAYNO	= Number of days since 1/1/50 (1/1/50 = 1)
			  (R1 for MACRO calls)
		ENCDAT	= Binary encoded date (R1 for MACRO calls)
			  <16 bits in the form yyyyyyymmmmddddd>
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = -2 if an invalid input date was specified
2	CDATDI

 This module converts a date from a number of days since 1950 to three
 integers for day, month & year

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	CDATDI (DAYNO,DAY,MONTH,YEAR [,STATUS])
 or
	STATUS = CDATDI (DAYNO,DAY,MONTH,YEAR)

 or
	CALL	CDATDI from MACRO-11 with
		R5 = 0
		R1 = DAYNO
		R0 = STATUS on output
		R1 = DAY on output
		R2 = MONTH on output
		R3 = YEAR on output

	Where:
		DAYNO	= Number of days since 1/1/50 (1/1/50 = 1)
		DAY	= Number of day (1-31)
		MONTH	= Number of month (1-12)
		YEAR	= Year since 1950 (1950=0)
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = -2 if an invalid input date was specified
2	CDATDW

 This  module  converts  a  date from a number of days since 1950 to a
 weekday number

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	CDATDW (DAYNO,WEKDAY [,STATUS])
 or
	STATUS = CDATDW (DAYNO,WEKDAY)

 or
	CALL	CDATDW from MACRO-11 with
		R5 = 0
		R1 = DAYNO
		R0 = STATUS on output
		R1 = WEKDAY on output (0 = Sunday)

	Where:
		DAYNO	= Number of days since 1/1/50 (1/1/50 = 1)
		WEKDAY = Weekday number (0 = Sunday)
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = -2 if an invalid input date was specified
2	CDATEA

 This module converts an encoded date into an ASCII date.

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	CDATEA (ENCDAT,DATE [,STATUS])
 or
	STATUS = CDATEA (ENCDAT,DATE)
 or
	CALL	CDATEA from MACRO-11 (with R5=0)

	Where:
		DATE	= ASCII date in form DD-MMM-YY 
			  (address in R1 for input,R4 for output for MACRO calls)
		ENCDAT	= Binary encoded date (R1 for MACRO calls)
			  <16 bits in the form yyyyyyymmmmddddd>
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = -2 if an invalid input date was specified
2	CDATED
 This module converts an encoded date to a number of days since 1950

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	CDATED (ENCDAT,DAYNO [,STATUS])
 or
	STATUS = CDATED (ENCDAT,DAYNO)
 or
	CALL	CDATED from MACRO-11 (with R5=0)

	Where:
		DAYNO	= Number of days since 1/1/50 (1/1/50 = 1)
			  (R1 for MACRO calls)
		ENCDAT	= Binary encoded date (R1 for MACRO calls)
			  <16 bits in the form yyyyyyymmmmddddd>
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = -2 if an invalid input date was specified
2	CDATEI

 This module converts an encoded date to three integers for day, month
 & year

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	CDATEI (ENCDAT,DAY,MONTH,YEAR [,STATUS])
 or
	STATUS = CDATEI (ENCDAT,DAY,MONTH,YEAR)

 or
	CALL	CDATEI from MACRO-11 with
		R5 = 0
		R1 = ENCDAT
		R0 = STATUS on output
		R1 = DAY on output
		R2 = MONTH on output
		R3 = YEAR on output

	Where:
		DAY	= Number of day (1-31)
		MONTH	= Number of month (1-12)
		YEAR	= Year since 1950 (1950=0)
		ENCDAT	= Encoded Date
			  <16 bits in the form yyyyyyymmmmddddd>
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = -2 if an invalid input date was specified
2	CDATEW

 This routine converts an encoded date to a weekday number

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	CDATEW (ENCDAT,WEKDAY [,STATUS])
 or
	STATUS = CDATEW (ENCDAT,WEKDAY)
 or
	CALL	CDATEW from MACRO-11 (with R5=0)

	Where:
		ENCDAT	= Binary encoded date (R1 for MACRO calls)
			  <16 bits in the form yyyyyyymmmmddddd>
		WEKDAY	= Weekday Number (Sunday=0) (R1 for MACRO calls)
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = -2 if an invalid input date was specified
2	CDATIA
 This module converts a date as three integers into an ASCII date

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	CDATIA (DAY,MONTH,YEAR,DATE [,STATUS])
 or
	STATUS = CDATIA (DAY,MONTH,YEAR,DATE)

 or
	CALL	CDATIA from MACRO-11 with
		R5 = 0
		R1 = DAY
		R2 = MONTH
		R3 = YEAR
		R4 = Address of DATE
		R0 = STATUS on output

	Where:
		DAY	= Number of day (1-31)
		MONTH	= Number of month (1-12)
		YEAR	= Year since 1950 (1950=0)
		DATE	= ASCII Date in form DD-MMM-YY
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = -2 if an invalid input date was specified
2	CDATID

 This module converts a date as three integers into the number of days
 since 1950

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	CDATID (DAY,MONTH,YEAR,DAYNO [,STATUS])
 or
	STATUS = CDATID (DAY,MONTH,YEAR,DAYNO)

 or
	CALL	CDATID from MACRO-11 with
		R5 = 0
		R1 = DAY
		R2 = MONTH
		R3 = YEAR
		R0 = STATUS on output
		R1 = DAYNO on output

	Where:
		DAY	= Number of day (1-31)
		MONTH	= Number of month (1-12)
		YEAR	= Year since 1950 (1950=0)
		DAYNO	= Number of days since 1/1/50 (1/1/50 = 1)
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = -2 if an invalid input date was specified
2	CDATIE

 This module converts a date as three integers into an encoded date

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	CDATIE (DAY,MONTH,YEAR,ENCDAT [,STATUS])
 or
	STATUS = CDATIE (DAY,MONTH,YEAR,ENCDAT)

 or
	CALL	CDATIE from MACRO-11 with
		R5 = 0
		R1 = DAY
		R2 = MONTH
		R3 = YEAR
		R0 = STATUS on output
		R1 = ENCDAT on output

	Where:
		DAY	= Number of day (1-31)
		MONTH	= Number of month (1-12)
		YEAR	= Year since 1950 (1950=0)
		ENCDAT	= Encoded Date
			  <16 bits in the form yyyyyyymmmmddddd>
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = -2 if an invalid input date was specified
2	CDATIW

 This module converts a date as three integers into a weekday number

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	CDATIW (DAY,MONTH,YEAR,WEKDAY [,STATUS])
 or
	STATUS = CDATIW (DAY,MONTH,YEAR,WEKDAY)
 or
	CALL	CDATIW from MACRO-11 (with R5=0)

	Where:
		DAY	= Number of day (1-31) (R1 for MACRO calls)
		MONTH	= Number of month (1-12) (R2 for MACRO calls)
		YEAR	= Year since 1950 (1950=0) (R3 for MACRO calls)
		WEKDAY	= Weekday Number (Sunday=0) (R1 for MACRO calls)
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = -2 if an invalid input date was specified
2	CTIMAD

 This module converts and ASCII time into seconds since midnight

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	CTIMAD (ZTIME,ISECS [,STATUS])
 or
	STATUS = CTIMAD (ZTIME,ISECS)

 or
	CALL	CTIMAD from MACRO-11 with
		R5 = 0
		R1 = Address of ZTIME for output
		R2 = Address of ISECS for output
		R0 = STATUS on output

	Where:
		ZDATE	= 10-byte array for ASCII Time
		ISECS	= Integer*4 seconds since midnight
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = -2 if the time was invalid
2	CTIMAI

 This module converts an ASCII time into four integers

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	CTIMAI (ZTIME,TIMTBL [,STATUS])
 or
	STATUS = CTIMAI (ZTIME,TIMTBL)

 or
	CALL	CTIMAI from MACRO-11 with
		R5 = 0
		R1 = Address of ZTIME for output
		R2 = Address of TIMTBL
		R0 = STATUS on output

	Where:
		ZDATE	= 10-byte array for ASCII Time
		TIMTBL	= 4-byte array for Hour, Minute, Second etc.
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = -2 if the time was invalid
2	CTIMDA

 This routine converts a time as seconds since midnight into an ASCII time

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	CTIMDA (ISECS,ZTIME,ILEN [,STATUS])
 or
	STATUS = CTIMDA (ISECS,ZTIME,ILEN)

 or
	CALL	CTIMDA from MACRO-11 with
		R5 = 0
		R1 = Address of ISECS 
		R2 = Address of ZTIME for output
		R3 = ILEN
		R0 = STATUS on output

	Where:
		ISECS	= Integer*4 seconds since midnight
		ZTIME	= 10-byte array for ASCII Time
		ILEN	= Length of ZDATE in bytes (0 => 10)
		STATUS = Optional error return

 Errors returned:
	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = -2 if the time was invalid
2	CTIMDI

 This routine converts a time as seconds since midnigt into four integers

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	CTIMDI (ISECS,TIMTBL [,STATUS])
 or
	STATUS = CTIMDI (ISECS,TIMTBL)

 or
	CALL	CTIMDI from MACRO-11 with
		R5 = 0
		R1 = Address of ISECS 
		R2 = Address of TIMTBL
		R0 = STATUS on output

	Where:
		ISECS	= Integer*4 seconds since midnight
		TIMTBL	= 4-byte array for Hour, Minute, Second etc.
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = -2 if the time was invalid
2	CTIMIA

 This routine converts a time as four integers into an ASCII time

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	CTIMIA (TIMTBL,ZTIME,ILEN [,STATUS])
 or
	STATUS = CTIMIA (TIMTBL,ZTIME,ILEN)

 or
	CALL	CTIMIA from MACRO-11 with
		R5 = 0
		R1 = Address of TIMTBL
		R2 = Address of ZTIME for output
		R3 = ILEN
		R0 = STATUS on output

	Where:
		TIMTBL	= 4-byte array for Hour, Minute, Second etc.
		ZDATE	= 10-byte array for ASCII Time
		ILEN	= Length of ZDATE in bytes (0 => 10)
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = -2 if the time was invalid
2	CTIMID

 This module converts a time as four integers into seconds since midnight

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	CTIMID (TIMTBL,ISECS [,STATUS])
 or
	STATUS = CTIMID (TIMTBL,ISECS)

 or
	CALL	CTIMID from MACRO-11 with
		R5 = 0
		R1 = Address of TIMTBL
		R2 = Address of ISECS for output
		R0 = STATUS on output

	Where:
		TIMTBL	= 4-byte array for Hour, Minute, Second etc.
		ISECS	= Integer*4 seconds since midnight
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
	       = -2 if the time was invalid
2	GTDATA

 This routine gets the current date in ASCII

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	GTDATA (DATE [,STATUS])
 or
	STATUS = GTDATA (DATE)

 or
	CALL	GTDATA from MACRO-11 with
		R5 = 0
		R4 = Address of DATE for output
		R0 = STATUS on output

	Where:
		DATE	= ASCII Date in form DD-MMM-YY
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
2	GTDATD

 This module gets the current date as days since 1950

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	GTDATD (DAYS [,STATUS])
 or
	STATUS = GTDATD (DAYS)

 or
	CALL	GTDATD from MACRO-11 with
		R5 = 0
		R1 = DAYS on output
		R0 = STATUS on output

	Where:
		DAYS	= Number of days since 1/1/50 (1/1/50=1)
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
2	GTDATE

 This routine gets the current date as an encoded date

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	GTDATE (ENCDAT [,STATUS])
 or
	STATUS = GTDATE (ENCDAT)

 or
	CALL	GTDATE from MACRO-11 with
		R5 = 0
		R1 = ENCDAT on output
		R0 = STATUS on output

	Where:
		ENCDAT	= Encoded Date
			  <16 bits in the form yyyyyyymmmmddddd>
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
2	GTDATI

 This routine gets the current date as three integers

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	GTDATI (DAY,MONTH,YEAR [,STATUS])
 or
	STATUS = GTDATI (DAY,MONTH,YEAR)

 or
	CALL	GTDATI from MACRO-11 with
		R5 = 0
		R1 = DAY on output
		R2 = MONTH on output
		R3 = YEAR on output
		R0 = STATUS on output

	Where:
		DAY	= Number of day (1-31)
		MONTH	= Number of month (1-12)
		YEAR	= Year since 1950 (1950=0)
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
2	GTDATW

 This routine gets the current weekday number

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	GTDATW (WEKDAY [,STATUS])
 or
	STATUS = GTDATW (WEKDAY)

 or
	CALL	GTDATW from MACRO-11 with
		R5 = 0
		R1 = WEKDAY on output
		R0 = STATUS on output

	Where:
		WEKDAY	= Weekday Number (0=Sunday)
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
2	GTTIMA

 This routine gets the current time as ASCII

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	GTTIMA (ZDATE,ILEN [,STATUS])
 or
	STATUS = GTTIMA (ZDATE,ILEN)

 or
	CALL	GTTIMA from MACRO-11 with
		R5 = 0
		R1 = Address of ZTIME for output
		R2 = ILEN
		R0 = STATUS on output

	Where:
		ZDATE	= 10-byte array for ASCII Time
		ILEN	= Length of ZDATE in bytes (0 => 10)
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
2	GTTIMD

 This module gets the current time as seconds since midnight

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	GTTIMD (ISECS [,STATUS])
 or
	STATUS = GTTIMD (ISECS)

 or
	CALL	GTTIMD from MACRO-11 with
		R5 = 0
		R1 = Address of ISECS
		R0 = STATUS on output

	Where:
		ISECS  = Integer*4 number of second since midnight
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected

2	GTTIMI

 This module gets the current time as four integers

	This subroutine is called via the standard FORTRAN calling sequence as:

	CALL	GTTIMI (TIMTBL [,STATUS])
 or
	STATUS = GTTIMI (TIMTBL)

 or
	CALL	GTTIMI from MACRO-11 with
		R5 = 0
		R1 = Address of 4-byte array to store time in
		R0 = STATUS on output

	Where:
		TIMTBL	= 4-byte array for Hour, Minute, Second etc.
		STATUS = Optional error return

 Errors returned:

	STATUS = 0 if the operation was successful
	       = -1 if a parameter error was detected
