Refer to non-standard filename in AS400 SQLRPGLE program

Posted on 2009-02-13
Last Modified: 2012-05-06
I would like to use an imbedded SQL statement within an AS400 SQLRPGLE program to retireve select records from a file that is named "Y.DPRMAS".  I continue to receive error message that "Object Qualified Name DPRMAS  not valid".  I was wondering if someone can give me an example of how to select records from a file with this naming convention?
Question by:jfvon
    LVL 34

    Accepted Solution

    A few of ideas:

    1) Switch the naming convention to *SYS from *SQL.  *SYS uses the "/" as a delimeter instead of the "." used by *SQL
    2) Create an alias for the file (CREATE ALIAS), and use the alias.  You may run into the same delimeter issue, though.
    3) Create a logical file over the file with a conforming name, and query the logical file.

    - Gary Patterson

    LVL 26

    Expert Comment

    Also, maybe try [select xxx from library."Y.DPRMAS"]. Quoting the name is sometimes successful.


    Author Closing Comment

    Thanks to both of you for your excellent suggestions.  I found that Gary's solution is elegant because it is simple enough for someone like me to use.  Creating the LF did the trick.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
    Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now