Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-09 - 43,50466/srt.doc
There are 2 other files named srt.doc in the archive. Click here to see a list.
			WESTERN MICHIGAN UNIVERSITY
				COMPUTER CENTER

LIBRARY PROGRAM #3.10.1

CALLING NAME:	SRT
PROGRAMMED BY:	SAM ANEMA *
PREPARED BY:	RUSSELL R. BARR
APPROVED BY:	JACK R. MEAGHER
DATE:		JUNE 1, 1975

			DATA FILE BREAKDOWN PROGRAM

TABLE OF CONTENTS

1.0  INTRODUCTION
2.0  DIALOGUE
3.0  LIMITATIONS
4.0  EXAMPLE

1.0 INTRODUCTION

THE SRT PROGRAM CREATES NEW DATA FILES BASED ON THE NUMERIC VALUE OF ONE
OR MORE ADJACENT COLUMNS IN A SOURCE DATA FILE (THAT IS, BASED ON
BREAKDOWN VARIBLE).  INPUT MUST CONSIST OF PHYSICAL RECORDS OF, AT MOST
80 COLUMNS.  MORE THAN ONE PHYSICAL RECORD PER OBSERVATION OR CASE IS
ALLOWED.

2.0  DIALOGUE

THERE ARE THREE DIFFERENT PROMPTINGS TO WHICH THE USER IS EXPECTED TO
RESPOND.

2.1 INPUT?(TYPE HELP IF NEEDED)--

THE PROPER RESPONSE TO THIS QUESTION DEFINES FROM WHERE THE USER WISHES TO READ
HIS DATA.

THE PROPER RESPONSE TO THIS QUESTION CONISITS OF THREE BASIC PARTS:
A DEVICE, A FILENAME, AND A PROJECT-PROGRAMMER NUMBER.

THE GENERAL FORMAT FOR THESE THREE PARTS IS AS FOLLOWS:  DEV:FILE.EXT[PROJ,PROG]

	DEVICE LIST			DEFINITION

	  TTY				TERMINAL
	  DSK:				DISK
	  CDR:				CARD READER
	  DTA0:				DECTAPE 0
 	  DTA1:				DECTAPE 1
	  DTA2:				DECTAPE 2
	  DTA3:				DECTAPE 3
	  DTA4:				DECTAPE 4
	  DTA5:				DECTAPE 5
	  DTA6:				DECTAPE 6


*  THIS PROGRAM WAS ORIGINALLY WRITTEN BY SAM ANEMA FOR WMU CENTER FOR 
SOCIOLOGICAL RESEARCH.




	DEVICE LIST			DEFINITION

	  DTA6:				DECTAPE 6
	  DTA7:				DECTAPE 7
	  MTA0:				MAGNETIC TAPE 0
	  MTA1:				MAGNETIC TAPE 1


	  
2)  FILE.EXT IS THE NAME AND EXTENSION OF THE FILE TO BE USED. THIS PART OF
THE SPECIFICATION IS USED ONLY IF DISK IS USED.

3)  [PROJ,PROG] IF A DISK IS USED AND THE USER WISHES TO  READ
A FILE IN ANOTHER PERSON'S DIRECTORY, HE MAY DO SO BY SPECIFYING THE  PROJECT-
PROGRAMMER NUMBER OF THE DIRECTORY FROM WHICH HE WISHES TO READ.  THE
PROJECT NUMBER AND THE PROGRAMMER NUMBER MUST BE SEPARTED BY A COMMA AND
ENCLOSED IN BRACKETS.

EXAMPLE:
		INPUT?	DSK:DATA.DAT[71171,71026]

THE INPUT DATA IS A DISK FILE OF NAME DATA.DAT IN USER DIRECORY [71171,71026]

DEFAULTS:

1)  IF NO DEVICE IS SPECIFIED BUT A FILENAME IS SPECIFIED THE DEFAULT DEVICE
WILL BE DSK:

2)  IF NO FILENAME IS SPECIFIED AND A DISK OR DECTAPE IS USED THE DEFAULT
ON INPUT WILL BE FROM INPUT.DAT.

3)  IF THE PROGRAM IS RUN FROM THE TERMINAL AND NO SPECIFICAION IS GIVEN
(JUST A CARRIAGE RETURN) THE INPUT DEVICE WILL BE THE TERMINAL.

4)  IF THE PROGRAM IS RUN THROUGH BATCH AND NO SPECFIFCATION IS GIVEN, 
(A BLANK CARD) THE INPUT DEVICE WILL BE CDR:

5)  IF NO PROJECT-PROGRAMMER NUMBER IS GIVEN, THE USER'S OWN NUMBER WILL BE
ASSUMED.

THE FOLLOWING TWO OPTIONS ARE NOT APPLICABLE FOR THE FIRST DATA SET I.E., 
IT IS APPLICABLE ONLY WHEN THE PROGRAM BRANCHES BACK TO INPUT? UPON FIRST
COMPLETION OF THE REST OF THE PROGRAM.

	(A) SAME OPTION
    	    UPON RETURNING TO INPUT?, IF THE SAME DATA FILE IS TO BE USED 
	    AGAIN, SIMPLY ENTER "SAME", OTHERWISE, EITHER USE THE FINISH
	    OPTION OR ENTER ANOTHER FILE NAME ETC.

	(B)  FINISH OPTION
	     THE USER MUST ENTER "FINISH" TO BRANCH OUT OF THE PROGRAM.
	     FAILURE IT DO SO MIGHT RESULT IN LOSING THE ENTIRE OUTPUT.

2.2 *

WHEN PROMPTED BY A STAR, THE USER TYPES IN A COMMAND WHICH DEFINES THE
POSTITION OF THE BREAKDOWN KEY, THE PHYSICAL RECORD IN WHICH IT IS LOCATED,
LARGEST PERMISSABLE VALUE OF EACH OF THE BREAKDOWN RANGES, AND THE TOTAL
NUMBER OF PHYSICAL RECORD PER CASE.  THE FOLLOWING EXAMPLE ILLUSTRATES
THE FORM OF THE COMMAND AND THE USE OF EACH PART:

EXAMPLE:
	B(9-11C2:9,25,71,125/3)

EXPLANATION:

9-11C2 MEANS THAT THE BREAKDOWN KEY IS IN COLUMN 9,10 AND 11 OF
PHYSICAL RECORD NUMBER 2. 9,25,71,125 MEAN THAT THERE ARE 4 RANGES AND
IF THE KEY IS LESS THAN OR EQUAL TO 9 IT IS IN THE FIRST RANGE; IF THE KEY
IS 10 TO 25, THE SECOND; 26 TO 71, THE THIRD; AND 72 TO 125 THE FOURTH.

IF THE KEY IS GREATER THAN 125, THE CASE IS IGNORED.
/3 INDICATES THAT THERE ARE 3 PHYSICAL RECORDS PER CASE.

DEFAULTS:

IF THE "C" FOLLWOED BY A NUMBER IS NOT SUPPLIED THE VALUE "C1" IS ASSUMED.
IF THE RANGE LIMITS OF THE KEY ARE OMITTED, AN OUTPUT FILE IS CREATED FOR
EACH VALUE OF THE KEY.
IF THE "/" FOLLOWED BY A NUMBER IS NOT SUPPLIED, THE VALUE "/1" IS ASSUMED.

EXAMPLE:
	B(3-7)

EXPLANATION:

THIS COMMAND MEANS THAT THE KEY IS ON THE FIRST PHYSICAL RECORD, AN OUTPUT
FILE WILL BE GENERATED FOR EACH VALUE OF THE KEYS (COLUMNS 3-7) AND EACH
CASE CONSISTS OF 1 PHYSICAL RECORD.

2.3  FILES? (4 CHARACTERS)

THE RESPEOSE TO THIS PROMPTING IS A 4 CHARACTER STRING WHICH WILL FORM
THE FIRST FOUR LETTERS OF THE OUTPUT FILES OF SRT.  IF THE USER  SUPPLIES
"WXYZ" AND HAS SPECIFED 3 RANGES, THE OUTPUT FILES WILL BE WXYZA.DAT,
WXYZB.DAT AND WXYZC.DAT.

AFTER THE USER RESPONDS, THE DATA WILL BE PROCESSED AND A SUMMARY OF
THE BREAKDOWN WILL BE PRINTED.  NEXT, THE PROGRAM WILL RETURN TO  THE
PROMPTING DESCRIBED IN SECTION 2.1 TO ALLOW YOU TO PROCESS ANOTHER INPUT
FILE DESIRED.


3.0 LIMITATIONS

1)  THE KEY FIELD IS LIMITED TO 10 INTER DIGITS OR LESS.

2)  THERE IS A LIMIT OF 20 BREAKDOWN RANGES.

3)  PHYSICAL REOCRDS MAY NOT BE LONGER THAN CHARACTERS.

4.0  EXAMPLE

4.1  TERMINAL EXAMPLE

BELOW IS A SAMPLE JOB WHERE THE INPUT FILE (FILE.DAT) HAS 2 PHYSICAL RECORDS
PER CASE AND THE KEY IS ON THE FIRST RECORD IN COLUMNS 3 AND 4.  THE
FILE IS TO BE SPLIT SO THAT ONE OUTPUT FILE HAS ALL CASES WITH A KEY
LESS THAN OR EQUAL TO 2.  ANOTHER FILE WILL HAVE CASES WITH KEYS 3 TO
17, ANOTHER 18 TO 21, AND THE LAST 22 TO 99.  ALL OTHER CASES WILL BE
OMITTED.

.TYPE FILE.DAT<CR>
1234
1122
1213
1123
1202
1111
1297
1212
1193
1234
1120
2122


.R SRT<CR>

WMU - CSR--DATA FILE BREAKDOWN PROGRAM

INPUT? (TYPE HELP IF NEEDED)--FILE.DAT<CR>

*B(3-4C1:2,17,21,99/2)<CR>

FILES?(4 CHARACTERS) ABCD<CR>
         NO OF
FILE    RECORDS    KEY

ABCDC      1        2
ABCDB      1       17
ABCDD      1       21
ABCDA      3       99


INPUT? (TYPE HELP IF NEEDED)--FINISH<CR>

END OF EXECUTION
CPU TIME:  0.34  ELAPSED TIME: 44.53
EXIT

.TYPE ABCDA.DAT<CR>
1234
1122
1297
1212
1193
1234

.TYPE ABCDB.DAT<CR>
1213
1123

.TYPE ABCDC.DAT<CR>
12 2
1111

.TYPE ABCDD.DAT<CR>
1120
2122



4.2  BATCH EXAMPLE

IN THE FOLLOWING BATCH JOB SETUP, EACH LINE REPRESENTS ONE CARD, EACH
CARD STARTING IN COLUMN 1.  DO NOT INCLUDE THE COMMENTS AT THE RIGHT.
SEE COMPUTER CENTER USERS GUIDE #7.

$JOB[###,###]			;###,###  REPRESENTS THE USER'S PROJECT-
				   PROGRAMMER NUMBER.
$PASSWORD ####			; #### REPRESNETS THE USER'S PASSWORD.

.R SRT				; RUN THE PROGRAM
	[COMMANDS TO SRT]

(EOF)				;END OF FILE CARD AVAILABLE
				;FROM THE COMPUTER CENTER.