AS400 Mid Range/ODBC Access AS/400

Advertisement


Question
Is it possible to access files across multiple libraries with one ODBC connection to Windows?
For example, I want to access fileA in xlibrary and fileB in ylibrary.  
Is there any special way to set up the connection?  

Answer
 I believe this is possible, but ODBC is not my area of expertise. I will have to do some research and get back to you on it.
Pete

additional information:

Roland;
  I called in a 'favor' from someone else I work with. Here is what he said about it.

This just requires that the DSN be configured to use system
naming convention rather than the default SQL naming convention. The
process is:

1) From the ODBC Data Source Administrator panel, select the DSN and
click the Configure button.

2) Select the Server tab.

3) Under the "Naming convention" drop down, choose "System naming
convention (*SYS)".

4) "SQL default library" can be left blank.

5) In the "Library list" text box, enter the name of the libraries you
desire, separated by spaces. This will then be the *USR portion of the
library list of the ODBC job.

If the ODBC connection has been started on the machine already, you may
need to reboot and reconnect to pick up the new configuration.

A heads up here: the client code using the ODBC connection should then
be sure not to specify a library (schema) when accessing any objects if
they want to traverse the library list for the first occurrence found:

select * from myfile;

If they need to directly specify a library and object to be accessed,
the convention changes from "dot notation" to "slash notation". For
example, under SQL naming convention, a select would be:

select * from mylib.myfile;

Under system naming convention, that would now be:

select * from mylib/myfile;

Hope this helps.
Pete

AS400 Mid Range

All Answers


Answers by Expert:


Ask Experts

Volunteer


Pete Mayhew

Expertise

Pretty much anything on the hardware/technical side. Some experience with Operating system installation/upgrade. Client Access configuration and connection. I cannot answer questions about RPG and/or application programs.

Experience

IBM Customer Engineer for 20 years, worked on AS400 from announcement until 'retired' in 1996. Have continued working on AS400/iSeries/i5 with an IBM Business Partner.

Education/Credentials
BS in Computers & Systems Engineering

Awards and Honors
IBM Certified Expert AS400 Design, Technical, Client Access, Windows Integration

©2012 About.com, a part of The New York Times Company. All rights reserved.