d DSGET: PROC(VAP,LINPTR,LINLEN); /* 'GET' A RECORD FROM A TEXT FILE TREATED AS A DATA SECTION. , IF RFM = VFC, LINPTR POINTS TO THE VARIABLE PORTION OF THE RECORD.  LINPTR IS DECLARED HERE AS FIXED BIN(31) FOR ARITHMETICAL CONVENIENCE.  THE CALLER SHOULD DECLARE IT PTR, AS IT POINTS TO THE LINE(RECORD) X CALL DSGET(VAP,LINPTR,LINLEN);  VAP (PTR) ->DATASECT CONTROL BLOCK, RETURNED FROM DSOPEN..  LINPTR (PTR) ->THE TEXT LINE (RECORD)  LINLEN (FIXED BIN(31)) ITS LENGTH  L E.G.: DCL LINE CHAR(80) BASED(LINPTR);  DCL VARLINE CHAR(80) VARYING;  VARLINE = SUBSTR(LINE,1,LINLEN); x LINPTR = NULL FLAGS END_OF_FILE  @ T DOW 6/17/82  **********************************************/  DCL VAP PTR; l DCL (LINPTR,LINLEN) FIXED BIN(31);  DCL 1 DS_CONTROL BASED(VAP), 4 2 LO_ADDR PTR,  2 HI_ADDR PTR,  2 NEXT_REC FIXED BIN(31), ` 2 LAST_BYTE FIXED BIN(31), 2 FAB, ( 3 FAB_FILL1 CHAR(31), 3 FAB_RFM CHAR(1), 3 FAB_FILL2 CHAR(22), T 3 FAB_MRS FIXED BIN(15), 3 FAB_FILL3 CHAR(7),  3 FAB_FSZ CHAR(1), 3 FAB_FILL4 CHAR(16); /* DS_CONTROL CONTINUES WITH THE XABFHC */ H DCL X_WORD FIXED BIN(15), X_BYTE CHAR(1) DEF(X_WORD);  DCL PTRA PTR, t PTRABIN FIXED BIN(31) DEF(PTRA);  DCL RECLEN FIXED BIN(15) BASED(PTRA); < DCL TOTLEN FIXED BIN(15);   IF NEXT_REC > LAST_BYTE THEN DO; h LINPTR = 0; /*NULL*/  LINLEN = 0; 0 END;  ELSE DO;  IF FAB_RFM = BYTE(3) /* VFC, E.G. FROM SOS EDITOR*/ THEN DO; \ PTRABIN = NEXT_REC;  TOTLEN = RECLEN; $ X_WORD = 0;  X_BYTE = FAB_FSZ;  PTRABIN = PTRABIN + X_WORD + 2; P LINPTR = PTRABIN;  LINLEN = TOTLEN - X_WORD;  IF MOD(TOTLEN,2) = 1 THEN NEXT_REC = PTRABIN + LINLEN + 1; | ELSE NEXT_REC = PTRABIN + LINLEN;  END; D ELSE IF FAB_RFM = BYTE(2) /* VAR, E.G. FROM EDT EDITOR */ THEN DO;  PTRABIN = NEXT_REC;  LINLEN = RECLEN; p PTRABIN = PTRABIN + 2;  LINPTR = PTRABIN; 8 IF MOD(LINLEN,2) = 1 THEN NEXT_REC = PTRABIN + LINLEN + 1;  ELSE NEXT_REC = PTRABIN + LINLEN;  END; d ELSE IF FAB_RFM = BYTE(1) /*FIXED LENGHT RECORDS*/ THEN DO;  LINPTR = NEXT_REC; , LINLEN = FAB_MRS;  NEXT_REC = NEXT_REC + LINLEN;  END; X ELSE /* IF UDF, E.G. BLOCK I/O */ DO;  LINPTR = NEXT_REC;  LINLEN = 512;  NEXT_REC = NEXT_REC + 512;  END; L END;  END DSGET;