COZ:Launcher bad substitution array processing

General discussion of the Co:Z Toolkit
Post Reply
tsdjim
Posts: 64
Joined: Fri May 07, 2010 2:21 am

COZ:Launcher bad substitution array processing

Post by tsdjim »

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: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: COZ:Launcher bad substitution array processing

Post by dovetail »

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 »

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 »

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