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
shell
jobs. - Specifying explicit local file paths where
shell
jobs should write their output. - Referencing local JCL files or JCL templates when using the
job.jcl
field (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.dat
inmyproject/grace.yml
resolves tomyproject/config/settings.dat
- e.g.
- If the path is an absolute path (e.g.
/tmp/absolute_file.log
or/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 aninput
for 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
shell
job to stage this file (e.g. by outputting to azos-temp://
orzos://
path, which is then consumed by the z/OS job).Here, the
shell
job 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 anoutput
for 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 subsequentshell
job would be needed to perform such a download.
-
⚠️ This is subject to change. Functionality for passing
file://
paths directly into z/OS jobinputs
oroutputs
block is in development.
-
Interaction with
shell
job 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 thegrace
command. grace deck
and uploads for z/OS job inputs:grace deck
does not automatically upload files referenced byfile://
injob.inputs
when those inputs are for z/OS job types. Use an intermediateshell
job (outputting tozos-temp://
orzos://
) if a downstream z/OS job needs this as an input.- When
file://
is used forjob.jcl
,grace deck
reads this local file (populates it with template vars if applicable) and uploads the resulting JCL content todatasets.jcl(JOBNAME)
grace run/submit
and downloads for z/OS job outputs:- Grace does not automatically download mainframe dataset outputs to local
file://
paths declared in z/OS joboutputs
. A subsequentshell
job is required to perform such a download.
- Grace does not automatically download mainframe dataset outputs to local
shell
job I/O: Forshell
jobs,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.yml
generally makes your workflow more portable, assuming the relative directory structure is maintained alongsidegrace.yml
. Absolute paths can limit portability.