COZ:Launcher bad substitution array processing

Discussion of the Co:Z Co-Processing Toolkit for z/OS
Post Reply
tsdjim
Posts: 64
Joined: Fri May 07, 2010 2:21 am

COZ:Launcher bad substitution array processing

Post by tsdjim » Mon Mar 18, 2013 1:29 am

I have a problem with array processing in COZ:Launcher which executes a script on Linuz. I am getting bad substitution when doing array processing, probably due to the special characters. This is a simulation script which gives bad substitution on ${array[@]}. The same works fine in Linux when executed as a script from the Linux shell:

STDIN DD *
array+=" first second third "
for i in "${array[@]}"
do
echo $i
done

dovetail
Site Admin
Posts: 1848
Joined: Thu Jul 29, 2004 12:12 pm

Re: COZ:Launcher bad substitution array processing

Post by dovetail » Mon Mar 18, 2013 7:41 pm

Co:Z Launcher uses something like the following command under the covers to read DD:STDIN:

fromdsn //DD:STDIN

This is coming from the remote/target system, so by default the data will be translated from the default z/OS (EBCDIC) codepage to the default/current codepage on the target system.
On z/OS, the default will probably be IBM-1047 (Latin-1 EBCDIC).

So, the question is this: is your STDIN input (on z/OS) using brackets in codepage IBM-1047?
If your TN3270 emulator is not using codepage IBM-1047, then probably not.

(In IBM-1047, [ is x'AD', and ] is x'BD' )

tsdjim
Posts: 64
Joined: Fri May 07, 2010 2:21 am

Re: COZ:Launcher bad substitution array processing

Post by tsdjim » Tue Mar 19, 2013 12:04 am

You were right!

My emulator codepage was 037 where [ is X'BA' and ] is X'BB' whereas it should be [ X'AD' and ]=X'BD' for codepage 1047 in COZ:LAUNCHER . I hex-edited the script on z/OS to correct the values and all works fine now.

Thanks for you help.

ashleygull
Posts: 1
Joined: Wed Dec 31, 2014 6:36 am

Re: COZ:Launcher bad substitution array processing

Post by ashleygull » Wed Dec 31, 2014 6:38 am

I don't know.
Does it work without OUTDES if you do it locally from a z/OS shell? (there should be absolutely no difference).
If not, you might open an ETR with IBM, or post a question to the mvs-oe list (the developer of BPXWDYN will often reply there).

Post Reply