{
  "name": "Documented example calls and results for the SAS INDEX, INDEXC, INDEXW and FIND functions",
  "description": "Example calls and returned positions taken from the SAS 9.3 Functions and CALL Routines Reference pages for four string-search functions, compiled into one table so the functions can be compared on identical terms.",
  "page": "https://casrai.org/guides/index-function-in-sas",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-25T15:45:00Z",
  "temporalCoverage": "SAS 9.3 reference",
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Function",
      "unit": "",
      "description": ""
    },
    {
      "name": "Call",
      "unit": "",
      "description": ""
    },
    {
      "name": "Result",
      "unit": "character position (0 = not found)",
      "description": ""
    }
  ],
  "rows": [
    {
      "Function": "INDEX",
      "Call": "index('ABC.DEF(X=Y)', 'X=Y')",
      "Result": 9
    },
    {
      "Function": "INDEX",
      "Call": "X=Y stored in a 14-character variable, no TRIM",
      "Result": 0
    },
    {
      "Function": "INDEX",
      "Call": "trim(variable) holding X=Y",
      "Result": 10
    },
    {
      "Function": "INDEXC",
      "Call": "indexc('ABC.DEP (X2=Y1)', '0123', ';()=.')",
      "Result": 4
    },
    {
      "Function": "INDEXC",
      "Call": "indexc('have a good day', 'pleasant', 'very')",
      "Result": 2
    },
    {
      "Function": "INDEXW",
      "Call": "indexw('asdf adog dog', 'dog')",
      "Result": 11
    },
    {
      "Function": "INDEXW",
      "Call": "indexw('abcdef x=y', 'def')",
      "Result": 0
    },
    {
      "Function": "FIND",
      "Call": "find('She sells seashells? Yes, she does.', 'she ')",
      "Result": 27
    },
    {
      "Function": "FIND",
      "Call": "same call with modifier 'i'",
      "Result": 1
    }
  ],
  "sources": [
    {
      "title": "INDEX Function, SAS 9.3 Functions and CALL Routines Reference",
      "url": "https://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/n0vxokxhv8lr84n10nrbnzp7gnba.htm",
      "accessed": "2026-11-17"
    },
    {
      "title": "INDEXC Function, SAS 9.3 Functions and CALL Routines Reference",
      "url": "https://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/n04ha26lk1sr1in1043awq6wav80.htm",
      "accessed": "2026-11-17"
    },
    {
      "title": "INDEXW Function, SAS 9.3 Functions and CALL Routines Reference",
      "url": "https://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/p0korze1qnq4len1mvlb5o98ht1n.htm",
      "accessed": "2026-11-17"
    },
    {
      "title": "FIND Function, SAS 9.3 Functions and CALL Routines Reference",
      "url": "https://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/p00ab6ey29t2i8n1ihel88tqtga9.htm",
      "accessed": "2026-11-17"
    }
  ]
}