Using files with multiple members in SQL or ODBC

I've come across problems when working in SQL and ODBC with specific members in files with multiple members.
This is a simple solution that I came up with -- without using the OVRDBF or CREATE ALIAS.

 Create an alias for the member of the file with multiple members: 


CRTDDMF FILE(library_name/ddm_file_name) RMTFILE(*NONSTD
'library_name/file_name(member_name)') RMTLOCNAME(*RDB)

library_name/ddm_file_name = alias for file member to use in file with
multiple members
library_name/file_name(member_name) = file member in file with multiple
local_rdb_name =   WRKRDBDIRE, see Relational Database Name (Remote
Location = *Local)



SELECT field1, field2, field3, field4 
FROM library_name/ddm_file_name
WHERE field1 = 'ABCDF' 



In the screen Select Tables, to select the file:
Then, it will visualize the fields of the file (they are really the
fields of the file: library_name/file_name(member_name)), to select the
fields and to usually continue    


The Best Web Links: Tips, tutorials and more.

Ask your systems management questions--or help out your peers by answering them--in our live discussion forums.

Read this Search400.com Featured Topic: Monitoring your iSeries system .

Ask the Experts yourself: Our systems management gurus are waiting to answer your technical questions.

This was first published in September 2004

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.