Pergunta

I am continuously learning about both the AS/400 and IBM i Series as of late and unfortunately I have extremely limited assistance in this small business setting -- aka I am the IT department. The AS/400 system is not similar to anything I've used before. It's quite obscure in my opinion.

Right now, the company I work for uses a Food Distribution Application to enter orders, invoice, query inventory, maintain inventory, etc., on the AS/400. Through the Food Distribution Application one can create custom queries using files with the "SH." prefix in them. For example, file "SH.ITEM" returns the inventory items in our warehouse. At the Advanced Sales Menu you type QRY and it allows you to proceed in creating a query using these files.

Instead of using the Food Distribution Application for queries, I'd like to be able to read these SH files directly. Currently, I am using SQL Squirrel (DB2) to read non-'SH.' prefixed schemas/tables but I of course can't use the .SH files. User defined queries can be queried using DB2 but the "SH." files cannot. The database name is QS36F. The files and user defined queries can be found via ftp in the folder server_root/QS36F.

How can I read the information being pulled by the .SH files using a programming language? My language of choice is python but pseudo code or recommendations to make this more seamless would be appreciated. The end goal is to use the AS/400 information to update other database systems.

Screenshots: Food Distribution Menu: enter image description here Creating Query for SH.ITEM: enter image description here SH.ITEM Report: enter image description here FTP Listing of server_root/QS36F: enter image description here

Foi útil?

Solução

I'm not familiar with SQL Squirrel but it's not clear why you can't read the "SH." prefixed files.

One possibility is the "." operator is the default separator between library (schema) and file (table) names when using SQL naming.

Try using quotes around the name, for example:

SELECT * FROM QS36F."SH.ITEM"

Also if you need access to specific members (partitions) you will need to create an alias to query against:

CREATE ALIAS QTEMP.M131204 FOR QS36F."SH.ITEM" (M131204);
SELECT * FROM QTEMP.M131204;

Due to the use of the QS36F library it's also possible these are not 'externally described files'. That means the tables may have only one big field to hold all of the individual field data and it is broken apart in the programs themselves.


DBVisualizer is a great third party SQL tool that can access a multitude of databases.

Outras dicas

QS36F is the library used to hold all the files used by S/36 emulated programs, so they are probably program-defined. The use of a prefix like SH. was a way to group similar files on the S/36, because files resided outside of any library.

There was a query product in the S/36. I know next to nothing about it, but I will bet the query capability of your application is built on it.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top