{"record":{"id":"afd4cde54b40f9b1","repo":"pentaho/pentaho-kettle","slug":"sasinput-log-error-unabletofindfilenamefield","errorCode":null,"errorMessage":"SASInput.Log.Error.UnableToFindFilenameField","messagePattern":"SASInput\\.Log\\.Error\\.UnableToFindFilenameField","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/sasinput/SasInput.java","lineNumber":84,"sourceCode":"      // No more work to do...\n      //\n      setOutputDone();\n      return false;\n    }\n\n    // First we see if we need to get a list of files from input...\n    //\n    if ( first ) {\n\n      // The output row meta data, what does it look like?\n      //\n      data.outputRowMeta = new RowMeta();\n\n      // See if the input row contains the filename field...\n      //\n      int idx = getInputRowMeta().indexOfValue( meta.getAcceptingField() );\n      if ( idx < 0 ) {\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"SASInput.Log.Error.UnableToFindFilenameField\", meta.getAcceptingField() ) );\n      }\n\n      // Determine the output row layout\n      //\n      data.outputRowMeta = getInputRowMeta().clone();\n      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,\n        metaStore );\n    }\n\n    String rawFilename = getInputRowMeta().getString( fileRowData, meta.getAcceptingField(), null );\n    final String filename =\n      KettleVFS.getFilename( KettleVFS.getInstance( getTransMeta().getBowl() ).getFileObject( rawFilename ) );\n\n    data.helper = new SasInputHelper( filename );\n    logBasic( BaseMessages.getString( PKG, \"SASInput.Log.OpenedSASFile\" ) + \" : [\" + data.helper + \"]\" );\n\n    // verify the row layout...","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/sasinput/SasInput.java#L66-L102","documentation":"KettleException thrown by the SAS Input step's processRow when the filename field configured in meta.getAcceptingField() is not present in the incoming row stream. The step expects to receive files via the 'accept file from field' mechanism, so it looks up the field index in the input RowMeta and fails with localized message SASInput.Log.Error.UnableToFindFilenameField when indexOfValue returns -1.","triggerScenarios":"processRow executes with accepting-filename mode enabled and the previous step's output does not contain the field named by the 'accepting field' setting; getInputRowMeta().indexOfValue returns < 0.","commonSituations":"Typo in the accepting field name; the upstream step was renamed or removed the field; the hop no longer exists so the input row layout lacks the field; transformation copied between environments where upstream metadata changed.","solutions":["Open the SAS Input step dialog and re-select the correct 'filename field' from the incoming fields list.","Verify the previous step actually outputs that field (use 'Get fields' in the dialog or preview the upstream step).","Ensure the hop providing the file names is connected and not removed by an earlier edit.","If files should be specified statically instead, disable 'Accept file names from previous step' and configure the file tab directly."],"exampleFix":"// before: field renamed upstream, accepting field stale\nmeta.setAcceptingField(\"filename_old\");\n// after: match the actual upstream field name\nmeta.setAcceptingField(\"filename\");","handlingStrategy":"validation","validationCode":"// Before running, verify the upstream step outputs the accepting field\nRowMetaInterface prev = transMeta.getPrevStepFields(stepMeta);\nif (prev.indexOfValue(meta.getAcceptingField()) < 0) {\n  throw new IllegalStateException(\"Upstream does not provide field: \" + meta.getAcceptingField());\n}","typeGuard":"if (meta.getAcceptingField() == null || meta.getAcceptingField().isEmpty()) {\n  throw new IllegalStateException(\"Accepting filename field is not configured\");\n}","tryCatchPattern":"try {\n  step.init(meta, data);\n  transMeta.prepareExecution(new String[0]);\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"UnableToFindFilenameField\")) {\n    log.error(\"Configure the SAS Input 'accepting field' to match an upstream column\");\n  }\n}","preventionTips":["Re-open the step dialog and use 'Get fields' after changing upstream steps.","Rename fields in one place only; check all dependent steps after renames.","Preview upstream rows before executing the transformation.","Disable 'accept filenames from previous step' when files are static."],"tags":["kettle","sas-input","field-mapping","runtime"],"backgroundTag":"field-not-found","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"}