0

I had an application packaged as .tar and FTP'ed it in binary to my zOS/linux directory.

I untar the package with tar -xvf successfully.

However when I try to run a setup.sh script for the application I get the error in the title:

FSUM7332 syntax error: got (, expecting Newline

I have tried:

  1. chown myuser setup.sh
  2. chmod 775 setup.sh
  3. Run a checksum against the .tar file before FTPing from my Windows 10 desktop to the z/OS linux directory in binary.
  4. Checked that the shebang was set to bash, which was correct.
  5. from the IBM website added these lines lust under the MOTD in the script text.
    unix_command=translate(unix_command,"-","(")
    unix_command=translate(unix_command,"-",")")
    to no avail.
  6. Used chtag and iconv to alter codepage from iso to IBM.

I still get the same error which prevents me from installing the app.

  • Can you post the script ? If it was edited on Windows you likely have carriage return / newlines that are translated incorrectly. You'll generally see these like a ^M – Hogstrom May 15 at 17:58
2
% dd conv=ascii << "EOT" | hexdump -C
#!/usr/local/bin/bash
echo My script has the letter M in it.
EOT
0+1 records in
0+1 records out
61 bytes transferred in 0.000029 secs (2097152 bytes/sec)
00000000  83 81 07 bf bd bc 07 25  3f b3 2f 25 07 b2 b9 3e  |.......%?./%...>|
00000010  07 b2 2f bd b8 8e b5 b3  b8 3f 80 28 60 80 bd b3  |../......?.(`...|
00000020  bc b9 ba be 80 b8 2f bd  80 be b8 b5 80 25 b5 be  |....../......%..|
00000030  be b5 bc 80 28 80 b9 3e  80 b9 be 06 8e           |....(..>.....|
0000003d
%

Your file, containing the script encoded in (most likely) UTF-8 or Latin-1, appears as gibberish on a system where text is encoded in EBCDIC. You need to re-encode it in EBCDIC.

Various z/OS things will do (a limited form of) this conversion automatically for you if you instruct them to, including Managed File Transfer. You are transferring a text file embedded within a ustar archive yourself, so you have to do the re-encoding manually yourself, almost certainly of more than just this one file.

Further reading

  • Just found out that my setup.sh is suitable for z/Linux on VM, not USS on z/OS, which I was playing with. zLinux is a complete image of Linux in a virtual machine whereas USS is just an interface to show a unix like structure with a few unix like functions. My setup.sh is not one of them, so thanks for the answer anyway. – Panda May 15 at 16:35
  • Thanks for the answers, much appreciated, but mute as I trying to do this on the wrong platform.. – Panda May 17 at 14:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.