.profile: ×ÁãÈ~aØÖ^×^Å^Õ⨢a^×^Ò^Ç¢a^Â^É^Õz[×ÁãÈ%: not found.

Issue #133 resolved
kapil tiwari created an issue

  1. when i run “call QP2term”

    ``` /QOpenSys/usr/bin/-sh

    .profile: ×ÁãÈ~aØÖ^×^Å^Õ⨢a^×^Ò^Ç¢a^Â^É^Õz[×ÁãÈ%: not found.
    $

    ```

2. this was not happening before , trying to resolve other issue for which i set path as per below guidlines. But that issue still not solved but started receiving junk char line.

If you want to make your PATH setting permanent, add the above line to your $HOME/.profile. You can do this easily (from a shell) like so.

echo 'PATH=/QOpenSys/pkgs/bin:$PATH' >> $HOME/.profile
echo 'export PATH' >> $HOME/.profile

3. just want to add what was the other issue i was trying to resolve -

a , Here is a .PY file in my server

 Browse : /home/kapilt/kt_py/PGM.PY                                      
 Record :       1   of       7 by  18                      Column :    1 
 Control :                                                               

....+....1....+....2....+....3....+....4....+....5....+....6....+....7...
 ************Beginning of data**************                             
from prettytable import from_db_cursor                                   
Import ibm_db_dbi as db2                                                 
conn = db2.connect()                                                     
cur = conn.cursor()                                                      
cur.execute("select * from qiws.qcustcdt")                               
# cur.execute("select * from qs36f.rfndcode fetch first 5 rows only")    
print(from_db_cursor(cur))                                               

when i invoke python3 /home/kapilt/kt_py/PGM.PY from QP2TERM environment

> python3 /home/kapilt/kt_py/PGM.PY          
    File "/home/kapilt/kt_py/PGM.PY", line 2 
      Import ibm_db_dbi as db2               
                      ^                      
  SyntaxError: invalid syntax                
  $                                          

Pl advise .

Comments (10)

  1. Kevin Adler

    Your .profile appears to be in EBCDIC. It must be in ASCII in order for it to be read by PASE shells such as in QP2TERM.

    As to your other issue, you will need to install python3-ibm_db with yum or the ACS GUI, though it seems that you were probably getting the Python 3 from 5733-OPS and were trying to set the PATH appropriately to get to the rpm Python 3 and ran in to this EBCDIC garbage issue.

  2. kapil tiwari reporter

    Please guid me little more about profile which your advising , is it my IBM i profile your talking about ?

    how to do it?

  3. Kevin Adler

    I am referring to the .profile file referenced in step 2 that you posted above.

    Easiest would be from QSH:

    mv .profile .profile2
    touch -C 819 .profile
    cat .profile2 > .profile
    

    When you’ve validated it’s working, you can get rid of .profile2

  4. kapil tiwari reporter

    QSH is not accepting - C . Pl advise.

                                                            QSH Command Entry 
    
      $                                                                       
    > mv .profile .profile2                                                   
      $                                                                       
    > touch -C 819 .profile                                                   
      /QOpenSys/pkgs/bin/touch: invalid option -- 'C'                         
      Try '/QOpenSys/pkgs/bin/touch --help' for more information.             
      $                                                                       
    

  5. kapil tiwari reporter
    1. I have got run touch -C 819 .profile , it was Capital -C causing error.
    2. Now pl see the screen '.profile: 0403-057 Syntax error:
                                                           /QOpenSys/usr/bin/-sh   
    
       .profile: 0403-057 Syntax error: `"' is not matched.                        
       $                                                                           
     > yum python3-ibm_db                                                          
       /QOpenSys/usr/bin/-sh: yum:  not found.                                     
       $                                                                           
    

    3. Kevin , I have re-installed everything from ACS help. Even yum too but yum too not found . Pl advise .

  6. Kevin Adler

    your .profile was in EBCDIC, but QSH reads this too and can understand EBCDIC, so it set your QSH PATH environment variable to add /QOpenSys/pkgs/bin to the PATH, which cause /QOpenSys/pkgs/bin/touch to be found instead of the QSH version, which understands -C. Re-installing packages with ACS will do nothing to fix your problem as it’s all a configuration issue.

    The easiest way to fix this would be to go in to QP2TERM and run these commands

    rm $HOME/.profile
    echo 'PATH=/QOpenSys/pkgs/bin:$PATH' >> $HOME/.profile
    echo 'export PATH' >> $HOME/.profile
    

    Running in QP2TERM instead of QSH will cause these files to be created in ASCII encoding instead of EBCDIC.

  7. kapil tiwari reporter

    Thank you Kevin , Junk char/Profile issue resolved.

    However primary issue still there -

    Import ibm_db_dbi , invalid systax-

    > yum install python3-pip python3-ibm_db python3-itoolkit                     
      ibm                                                         | 3.6 kB  00:00 
      Setting up Install Process                                                  
      Package python3-pip-9.0.1-3.noarch already installed and latest version     
      Package python3-ibm_db-2.0.5.12-0.ppc64 already installed and latest version
      Package python3-itoolkit-1.6.1-1.ppc64 already installed and latest version 
      Nothing to do                                                               
      $                                                                           
    > python3 /home/kapilt/kt_py/PGM.PY                                           
        File "/home/kapilt/kt_py/PGM.PY", line 2                                  
          Import ibm_db_dbi as db2                                                
                          ^                                                       
      SyntaxError: invalid syntax                                                 
      $                                                                           
    

  8. Jesse G

    Looks like you have Import instead of import (all lowercase). Since language keywords are case sensitive, I think that’s your problem. Please lowercase and retry.

  9. Log in to comment