No announcement yet.

Configuring EXPECT and TCL on IBMi

  • Filter
  • Time
  • Show
Clear All
new posts

  • Configuring EXPECT and TCL on IBMi

    I have been configuring SFTP on a new IBMi.

    It works great on the current IBMi (Installed many many years ago!) . On the new system when the script is executed i receive the below error:

    001-0050 Syntax error on line 1: token ")" not expected.

    The script is as follows:

    PATH=úPATH:/usr/local/bin && expect -f /Aquatmp/exp_236953.inp

    This same error occurs whatever I enter for the file parameter, even junk characters or leave it blank so i do not think its an issue with the script.

    Has anyone experienced this issue before? I am guessing its a character translation issue or perhaps an issue with the installation of EXPECT/TCL tools?.

    On the working IBMi the /usr/local/bin folder has a ccsid of 819 but on the new system it is set at 285. Could this be the issue?

    I thought I had installed Expect and TCL correctly as i downloaded expect.5.43.tar.Z and tcl.8.4.9.tar.Z. Uncompressed them both via QSH and ran "tar xf".

    Any help would be much appreciated!


  • #2
    The PASE environment runs Unix programs and scripts, and they aren't going to understand EBCDIC, so you can't use ccsid 285.


    • ewood1rpg
      ewood1rpg commented
      Editing a comment
      Thanks for your response! It was indeed a CCSID problem. I changed the root directory of /usr/local/bin to 819 then re-extracted as per the below

      $ cd /tmp
      $ uncompress tcl.8.4.9.tar.Z
      $ uncompress expect.5.43.tar.Z
      $ cd /
      $ tar xf /tmp/tcl.8.4.9.tar
      $ tar xf /tmp/expect.5.43.tar
      $ ln -s /qopensys/usr/bin/stty /usr/local/bin/stty

      It now works perfectly!