Continuation Characters ( - and + ) in z/OS Handler Script
Continuation characters ( - and + ) are useful when you want to execute a script line that is longer than your available z/OS character space.
The - character will preserve trailing spaces in your line. The + character will not preserve trailing spaces in your line.
Examples
The following example shows the use of -to preserve a trailing space.
The following z/OS handler script:
begin_script
stmt "ls -a - <---- Notice the continuation character "-"
>dirfile"
end_script
Will produce the following output when loaded to the uemh.db:
Handler ID...................: MFCTRIGGER_1
Handler Type.................: SCRIPT
Max Acceptable Return Code...: 0
Encrypted User File..........:
User ID......................: mfc1a
Script statements:
ls -a >dirfile
Script Type..................: bat
Command Line Options.........:
Last Modified On.............: 06/11/11 10:32:31 AM
Last Modified By.............: mfc1a
The following example shows the use of + to omit a trailing space.
The following z/OS handler script:
begin_script
stmt "ls -a >dir + <---- Notice the continuation character "+"
file"
end_script
Will produce the following output when loaded to the uemh.db:
Handler ID...................: MFCTRIGGER_1
Handler Type.................: SCRIPT
Max Acceptable Return Code...: 0
Encrypted User File..........:
User ID......................: mfc1a
Script statements:
ls -a >dirfile
Script Type..................: bat
Command Line Options.........:
Last Modified On.............: 06/11/11 11:46:32 AM
Last Modified By.............: mfc1a
The following example shows the use of + to concatenate a command line or a word within a z/OS script without a space, and the use of - to continue a line of script where a space is required within the same z/OS handler script.
The following z/OS handler script:
begin_script
stmt "ls -a >dir +
file"
stmt "uemFName=`basename \u201c$UEMORIGFILE\u201d | sed 's/\(.*\)+
\.\(.*$\)/\1/'`"
stmt "fname=$uemFName.$dt.$tm.$pid.txt"
stmt " ls -al >dir+
data"
stmt "ls -a -
>new+
data"
end_script
Will produce the following output when loaded to the uemh.db:
Handler ID...................: MFCTRIGGER_1
Handler Type.................: SCRIPT
Max Acceptable Return Code...: 0
Encrypted User File..........:
User ID......................: mfc1a
Script statements:
ls -a >dirfile
uemFName=`basename \u201c$UEMORIGFILE\u201d | sed 's/\(.*\)\.\(.*\)/\1/'`
fname=$uemFName.$dt.$tm.$pid.txt
ls -al >dirdata
ls -a >newdata
Script Type..................: bat
Command Line Options.........:
Last Modified On.............: 06/11/1 01:25:20 PM
Last Modified By.............: mfc1a