iSeriesPython

os400 Module

The os400 module have these functions.

Program(name, lib, parameters)
Returns a Program object.
Name should be the name of the program (uppercase).
Lib is the library, the special value *LIBL is supported.
Parmeters should be a tuple of parameter descriptions.
There is a limit of 10 parameters.
Each parameter description shold be a tuple with the following fields:
Type(string), length(int), decimals(int, optional).
  The following types are valid:
    'c' String. ('c',20)
    'i' Binary(Integer). ('i', 4) Length is here number of bytes (4/8).
    'f' Float. ('f', 4) Length is here number of bytes (4/8).
    'd' packed decimal ('d',5,0)
    'z' Zoned decimal ('z',5,0)
The Program object has the following methodes:
  resolve - Do a new resolve.
To see values after the call use indexing. (print mypgm1[0])
You can also set the parameters this way, but normaly you don't want to.
Here is an example:
  getprice = os400.Program('GETPRICE','*LIBL',(('c',10),('d',9,0)))
  getprice('PART_A',0)
  price = getprice[1]

rtvdtaara(name, lib, length)
Returns data area value.

chgdtaara(name, lib, value)
Change data area.

commit()
Commit changes done by File400 file objects.

rollback()
Rollback changes done by File400 file objects.

Codec(ccsid)
Returns a Codec object, ccsid should be the ccsid to convert from/to.