I'm experiencing errors if I escape a newline in a piped command at positions which normally should work (outside JCL and COZBATCH).
Here is the working code:
Code: Select all
[JOBCARD]
// EXPORT SYMLIST=(JP,RS)
// SET JP='/somepath/tmp'
// SET RS='somestringwhichshouldbereplaced'
// EXEC PGM=COZBATCH,PARM='-LD'
//STEPLIB DD DSN=DOS.COZBATCH.LOADLIB,DISP=SHR
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*
//STDIN DD DATA,DLM=@@,SYMBOLS=JCLONLY
cp "&JP./somefile" "&JP./somefile.old"
cat "&JP./somefile.old" | \
sed "s;^&RS.;\
#&RS.;" \
> "&JP./lib/net.properties"
@@
Code: Select all
[...]
cat "&JP./somefile.old" | \
sed "s;^&RS.;#&RS.;" \
> "&JP./somefile"
@@
Code: Select all
[...]
cat "&JP./somefile.old" | \
sed "s;^&RS.;\
#&RS.;" > "&JP./somefile"
@@
Code: Select all
[...]
cat "&JP./somefile.old" | \
sed "s;^&RS.;#&RS.;" > "&JP./somefile"
@@
Best,
Benjamin.
[edit] P.S. This is the error I got:
Code: Select all
CoZBatch[N]: Copyright (C) 2005-2013 Dovetailed Technologies LLC. All rights reserved.
CoZBatch[N]: version 3.5.1 2015-10-09
CoZBatch[I]: executing progname=login-shell="-/bin/sh"
CoZBatch[E]: ./CoZBatch.C(268) - fgets(28609470,8192,2865E138) - [66] EDC5066I A read system error was detected.
(errno2=0xC044000D)
CoZBatch[W]: an error occurred; returning rc=102