Files referenced with the _file= parameter in SAS® Job Execution might fail to load


You can reference supporting files (for example, JavaScript and CSS) in SAS Job Execution HTML output by uploading those files to the Files service and then retrieving them through the SAS Job Execution Web Application using the _file= parameter.

For more information, see Deploy DDC Implementation Files in SAS Content Server via SAS Viya GUIs (SAS Communities).

In some environments, however, files referenced via _file= might intermittently fail to load and generate errors that prevent the referenced resources from running correctly. This is a known issue in SAS® Viya®. Until a permanent fix is available, complete the workarounds below to circumvent the issue.

Note: The examples below follow the approach described in the SAS Communities article linked above.


Workarounds

Complete any of the following workarounds to circumvent this issue:

Method 1: Embed the Resource Reference as Plain Text in the Job’s Form Code

Instead of relying on _file= as a runtime fetch, include the code reference as plain text directly within the Form Code section of the SAS Job Execution job. This workaround can avoid intermittent file retrieval or serving failures.

Screenshot of the code reference as plain text directly within the Form Code section of the SAS Job Execution job.

Method 2: Import Files Without Extensions

When you import files through the SAS Job Execution wizard, do not include a file extension in the imported name.

Here is an example:

Then, reference the resources using the imported name (without an extension). This workaround reduces failures when serving content through _file=.

Screenshot of the reference the resources using the imported name (without an extension)

Method 3: Reference the Files Service URL Directly (/files/files/.../content)

Instead of retrieving resources through _file=, reference the file directly using the Files service path:

  1. Start with the /files/files/... URL obtained from the file’s properties.
  2. Append /content to the end of the path.

This approach bypasses _file= and relies on the Files service to deliver the resource directly.

Screenshot of an example that references the file directly using the Files service path


Additional Notes

If you are troubleshooting a failure, confirm that the file returns with the correct HTTP status code and Content-Type. (For example, JavaScript should be returned as JavaScript, not text/plain.) Browser developer tools (the Network tab) are the fastest way to verify what is actually being served.