in src/main/java/com/epam/parso/impl/SasFileParser.java [1667:1711]
public void processSubheader(long subheaderOffset, long subheaderLength) throws IOException {
int intOrLongLength = sasFileProperties.isU64() ? BYTES_IN_LONG : BYTES_IN_INT;
Long[] offset = {subheaderOffset + COLUMN_FORMAT_WIDTH_OFFSET + 3 * intOrLongLength,
subheaderOffset + COLUMN_FORMAT_PRECISION_OFFSET + 3 * intOrLongLength,
subheaderOffset + COLUMN_FORMAT_TEXT_SUBHEADER_INDEX_OFFSET + 3 * intOrLongLength,
subheaderOffset + COLUMN_FORMAT_OFFSET_OFFSET + 3 * intOrLongLength,
subheaderOffset + COLUMN_FORMAT_LENGTH_OFFSET + 3 * intOrLongLength,
subheaderOffset + COLUMN_LABEL_TEXT_SUBHEADER_INDEX_OFFSET + 3 * intOrLongLength,
subheaderOffset + COLUMN_LABEL_OFFSET_OFFSET + 3 * intOrLongLength,
subheaderOffset + COLUMN_LABEL_LENGTH_OFFSET + 3 * intOrLongLength};
Integer[] length = {COLUMN_FORMAT_WIDTH_OFFSET_LENGTH, COLUMN_FORMAT_PRECISION_OFFSET_LENGTH,
COLUMN_FORMAT_TEXT_SUBHEADER_INDEX_LENGTH, COLUMN_FORMAT_OFFSET_LENGTH, COLUMN_FORMAT_LENGTH_LENGTH,
COLUMN_LABEL_TEXT_SUBHEADER_INDEX_LENGTH, COLUMN_LABEL_OFFSET_LENGTH, COLUMN_LABEL_LENGTH_LENGTH};
List<byte[]> vars = getBytesFromFile(offset, length);
int columnFormatWidth = bytesToShort(vars.get(0));
int columnFormatPrecision = bytesToShort(vars.get(1));
int textSubheaderIndexForFormat = bytesToShort(vars.get(2));
int columnFormatOffset = bytesToShort(vars.get(3));
int columnFormatLength = bytesToShort(vars.get(4));
int textSubheaderIndexForLabel = bytesToShort(vars.get(5));
int columnLabelOffset = bytesToShort(vars.get(6));
int columnLabelLength = bytesToShort(vars.get(7));
String columnLabel = "";
String columnFormatName = "";
if (textSubheaderIndexForLabel < columnsNamesBytes.size()) {
columnLabel = bytesToString(columnsNamesBytes.get(textSubheaderIndexForLabel),
columnLabelOffset, columnLabelLength).intern();
} else {
columnMissingInfoList.add(new ColumnMissingInfo(columns.size(), textSubheaderIndexForLabel,
columnLabelOffset, columnLabelLength, ColumnMissingInfo.MissingInfoType.LABEL));
}
if (textSubheaderIndexForFormat < columnsNamesBytes.size()) {
columnFormatName = bytesToString(columnsNamesBytes.get(textSubheaderIndexForFormat),
columnFormatOffset, columnFormatLength).intern();
} else {
columnMissingInfoList.add(new ColumnMissingInfo(columns.size(), textSubheaderIndexForFormat,
columnFormatOffset, columnFormatLength, ColumnMissingInfo.MissingInfoType.FORMAT));
}
LOGGER.debug(COLUMN_FORMAT, columnFormatName);
ColumnFormat columnFormat = new ColumnFormat(columnFormatName, columnFormatWidth, columnFormatPrecision);
columns.add(new Column(currentColumnNumber + 1, columnsNamesList.get(columns.size()),
columnLabel, columnFormat, columnsTypesList.get(columns.size()),
columnsDataLength.get(currentColumnNumber++)));
}