file://
The file:// prefix refers to files on the local filesystem where Grace is being executed. It's used for:
- Providing local data files, configuration files, or other resources as input to
shelljobs. - Specifying explicit local file paths where
shelljobs should write their output. - Referencing local JCL files or JCL templates when using the
job.jclfield (e.g.jcl://./mycustom.jcl).
Resolution
-
Local file path:
- If the path following
file://starts with./or is a relative path (e.g.data/input.csv), Grace resolves it relative to the Grace workflow directory (containinggrace.yml).- e.g.
path: file://./config/settings.datinmyproject/grace.ymlresolves tomyproject/config/settings.dat
- e.g.
- If the path is an absolute path (e.g.
/tmp/absolute_file.logor/home/user/file.txt), Grace uses that absolute path directly.- e.g.
path: file:///var/log/app_extract.log
- e.g.
- If the path following
-
Interaction with z/OS job modules (
compile,linkedit,execute):-
As an
input:When
file://<local_path>is specified as aninputfor a z/OS job type, Grace does not upload this to the mainframe duringgrace deck. Consequently, Grace's default JCL templates cannot generate a DD statement that directly allows a mainframe job to access this local file.To use the content of such a file as input to a z/OS job, you should typically use a preceding
shelljob to stage this file (e.g. by outputting to azos-temp://orzos://path, which is then consumed by the z/OS job).Here, the
shelljob accesses thefile://input locally, and its output (zos-temp://) is now usable by a downstream z/OS job. -
As an
output:If
file://<local_path>is specified as anoutputfor a z/OS job type, Grace does not automatically download the corresponding dataset to this localfile://path after the z/OS job completes. Similar to the above example, a subsequentshelljob would be needed to perform such a download.
-
⚠️ This is subject to change. Functionality for passing
file://paths directly into z/OS jobinputsoroutputsblock is in development.
-
Interaction with
shelljob modules:- As an
input: TheGRACE_INPUT_*environment variable exposed to the shell script will contain the resolved absolute local path to the file. - As an
output: TheGRACE_OUTPUT_*environment variable will contain the resolved absolute local path where the shell script is expected to write this output file.
- As an
Typical usage examples
Input to a shell job:
Output from a shell job to a specific local file:
Using a local JCL file/template for a z/OS job:
Staging a local file for mainframe use via a shell job:
Key considerations
- Scope of access:
file://paths always refer to the filesystem accessible by the machine running thegracecommand. grace deckand uploads for z/OS job inputs:grace deckdoes not automatically upload files referenced byfile://injob.inputswhen those inputs are for z/OS job types. Use an intermediateshelljob (outputting tozos-temp://orzos://) if a downstream z/OS job needs this as an input.- When
file://is used forjob.jcl,grace deckreads this local file (populates it with template vars if applicable) and uploads the resulting JCL content todatasets.jcl(JOBNAME)
grace run/submitand downloads for z/OS job outputs:- Grace does not automatically download mainframe dataset outputs to local
file://paths declared in z/OS joboutputs. A subsequentshelljob is required to perform such a download.
- Grace does not automatically download mainframe dataset outputs to local
shelljob I/O: Forshelljobs,GRACE_INPUT_*andGRACE_OUTPUT_*environment variables provide the direct, resolved local file paths for the script's use.- Portability: Using relative paths (e.g.
file://data/file.txt) within yourgrace.ymlgenerally makes your workflow more portable, assuming the relative directory structure is maintained alongsidegrace.yml. Absolute paths can limit portability.