Google
 

Trailing-Edge - PDP-10 Archives - BB-AI48A-BM - datatrieve/demo/make_session.cdd-procedure
There are no other files named make_session.cdd-procedure in the archive.
&PRINT " This procedure extracts the records which make up session entries"
#PRINT " from a TOPS-20 Ascii usage file and writes a data file with"
PRINT " single records per entry.",SKIP
!PRINT " Usage records are read from the domain USAGEF (USAGE.DAT"
#PRINT " in your connected directory) and session records are written"
&PRINT " to domain SESSION (SESSION.DAT in your connected directory).",SKIP
PRINT "Creating SESSION file..."
DEFINE FILE SESSION, SUPER, MAX
READY USAGEF READ, SESSION WRITE

DECLARE REC1 PIC X(85).
IC X(147).

DECLARE REC3 PIC X(59).
PRINT "Writing records to session file..."
FOR ALL USAGEF
 BEGIN
   IF SOURCE-RECORD-SEQUENCE-NUMBER = 1 AND REC1 NOT = " " THEN
    BEGIN
      STORE SESSION USING SINGLE-FIELD = REC1 | REC2 | REC3
	      REC1 = " "
    END ELSE
 IF SOURCE-ENTRY-TYPE = 2 THEN
 BEGIN
   IF SOURCE-RECORD-SEQUENCE-NUMBER = 1 THEN REC1 = USAGE-RECORD
   IF SOURCE-RECORD-SEQUENCE-NUMBER = 2 THEN REC2 = USAGE-RECORD
   IF SOURCE-RECORD-SEQUENCE-NUMBER = 3 THEN REC3 = USAGE-RECORD
 END
 END
RELEASE ALL
FINISH USAGEF
PRINT COUNT OF SESSION (-), "records written."