|
The command line tool xgdg is used to interface the XGDG subsystem.
Syntax
xgdg [options] [<args>]
Parameters
-c, --catalogue
|
catalogues GDG files used in the job
|
-u, --uncatalogue <n>
|
uncatalogues file number <n>
|
-d, --dlbl
|
returns the real name of the GDG file specified in the argument in a dlbl_format. Argument must be specified in a dlbl_ format.
|
-g, --get <gdg>
|
returns the real name of the <gdg> GDG file specified in the argument.
|
-f, --full
|
returns the full path name of the <gdg> GDG file specified in the argument.
|
-i, --info
|
shows information about configuration for all files or for the specified one.
|
-v, --verbose
|
runs in verbose mode
|
Environment variables
Environment name
|
Description
|
XJCLLOG
|
environment value MUST be set to a unique file identifier for any JOB using xlst (see xrun).
|
Notes
| • | xgdg command line is not required when files are accessed from a program run using "xrun". |
| • | xgdg --catalogue MUST be issued at the end of scripts using GDG files |
| • | xgdg --uncatalogue may be used only on catalogued versions (negative or zero) |
Example
#!/bin/ksh
#
export XJCLLOG=$$.log
rm -f $XJCLLOG
filein=$(xgdg --full --get 0 $XVSAM/FLAT/FILE01)
fileout=$(xgdg --full --get +1 $XVSAM/FLAT/FILE01)
sort < $filein > $fileout
xgdg --catalogue
Path name resolution
Any reference (in configuration or in commands) to non-absolute path name, causes XGDG to consider the file under the $XVSAM path. Therefore to define a file like the following
define name=FLATCAT/FILE01.DAT
is the same as specifing the full path name including $XVSAM ($XVSAM/FLATCAT/FILE01.DAT)
The same appens using commands:
filein=$(xgdg --full --get 0 FLAT/FILE01)
is the same as:
filein=$(xgdg --full --get 0 $XVSAM/FLAT/FILE01)
Obviously, absolute paths are left unchanged:
filein=$(xgdg --full --get 0 /home/data/FLAT/FILE01)
Configuration file
This is the file which controls the behaviour of xgdg and it is named xgdg.conf and contained in $HOME/etc. Configuration is specified using the following commands
Parameter definition
General parameters are defined using the set directive
Syntax
set <parameter>[=<value>]
Parameters
verbose
|
if specified xgdg runs in verbose mode
|
keep(<condition>)
|
defines the test to be verified when deciding if a GDG file must be kept or deleted
|
reverse_concatenation
|
by default xgdg concatenates the GDG files (gdg=all) in descending order (from older to newer). Setting reverse_concatenation cause an ascending concatenation (from newer to older)
|
Files definition
In order to have GDG working properly on a certain file it must be defined in xgdg.conf. If a file is not defined but GDG handling is requested for it, default values are assumed.
Syntax
define name=<fileid> [group=<gdg>] [record_length=<recl>]
Parameters
name=<fileid>
|
this parameter is mandatory. It defines the file identifier, which can be:
| • | a path relative to $XVSAM |
|
group=<gdg>
|
specifies the GDG width. Default is 8 (eight)
|
record_length=<recl>
|
specifies the record length for the file. If xrun runs in EBM mode, the parameter specifies the ddname_LRECL parm (in lrecl is not specified in the dlbl_)
|
An example
#
# configuration for xgdg
#
set keep($RC < 8)
set verbose
define name=CATALOG1/FILE01.DATA group=4
define name=CATALOG1/EXXP.BCKJHS group=4
define name=CATALOG2/EYYP.ADDRSF group=4 record_length=500
define name=CATALOG2/EZPO.PEXZXQ group=4 record_length=506
|