{"record":{"id":"b16e956be4b3fa82","repo":"pentaho/pentaho-kettle","slug":"unhandled-sas-data-type-encountered-type","errorCode":null,"errorMessage":"Unhandled SAS data type encountered: {type}","messagePattern":"Unhandled SAS data type encountered: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/sasinput/SasInputHelper.java","lineNumber":70,"sourceCode":"    // Determine the row layout of the file ...\n    //\n    try {\n      rowMeta = new RowMeta();\n      sasReader.read( new SasReaderCallback() {\n        public void column( int index, String name, String label, SasColumnType type, int length ) {\n          int kettleType = ValueMetaInterface.TYPE_NONE;\n          int kettleLength;\n          switch ( type ) {\n            case CHARACTER:\n              kettleType = ValueMetaInterface.TYPE_STRING;\n              kettleLength = length;\n              break;\n            case NUMERIC:\n              kettleType = ValueMetaInterface.TYPE_NUMBER;\n              kettleLength = -1;\n              break;\n            default:\n              throw new RuntimeException( \"Unhandled SAS data type encountered: \" + type );\n          }\n          try {\n            ValueMetaInterface valueMeta = ValueMetaFactory.createValueMeta( name, kettleType );\n            valueMeta.setLength( kettleLength );\n            valueMeta.setComments( label );\n            rowMeta.addValueMeta( valueMeta );\n          } catch ( Exception e ) {\n            throw new SasReaderException( \"Unable to create new value meta type\", e );\n          }\n        }\n\n        public boolean readData() {\n          return false;\n        }\n\n        public boolean row( int rowNumber, Object[] rowData ) {\n          return true;\n        }","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/sasinput/SasInputHelper.java#L52-L88","documentation":"While building the row layout, the SasInputHelper's column callback maps each SAS column type (CHARACTER, NUMERIC) to a Kettle type; any other SAS type hits default and throws a RuntimeException naming the type. The step only supports character and numeric SAS columns.","triggerScenarios":"The SAS7BAT file declares a column whose type enum is neither CHARACTER nor NUMERIC, so the switch in column() reaches default.","commonSituations":"SAS files produced by non-standard writers emitting exotic column types; binary or date-typed columns from certain SAS export variants; library version gaps where newer SAS types are unknown.","solutions":["Re-export the SAS file so all columns are character or numeric.","Drop or convert the unsupported column in SAS before export.","Extend the switch in SasInputHelper to map the new SAS type to a Kettle type."],"exampleFix":"// before: default: throw new RuntimeException(\"Unhandled SAS data type encountered: \" + type);\n// after: case DATE: kettleType = ValueMetaInterface.TYPE_DATE; break;\n//        default: throw new RuntimeException(...);","handlingStrategy":"validation","validationCode":"// Reject files with unsupported SAS column types before processing\nfor (SasField col : sasColumns(file)) {\n  switch (col.getType()) {\n    case CHARACTER:\n    case NUMERIC:\n      break;\n    default:\n      throw new IllegalArgumentException(\"Unsupported SAS type \" + col.getType() + \" for column \" + col.getName());\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Normalize all source exports to CHARACTER/NUMERIC columns.","Scan new upstream files for exotic types during intake QA.","Track SAS writer tool versions that may emit new column types."],"tags":["sas","unsupported-type","column-type","etl"],"backgroundTag":"unsupported-enum-value","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}