Can you mass change file libraries in AS/400 query?

13050 pts.
Tags:
AS/400 queries
V6R1
WRKQRY
Here's a tough one. We currently have a few hundred user defined queries. Created with the WRKQRY command. We are looking at a software upgrade that now puts the production data in a new library. When a user creates a querey and leaves the library *LIBL,  it defaults in the first library it finds the data file in. This would be great if the *LIBL stayed as it would always grab the current production library. It does not. This means our department and the users need to change every querey defined. It's a simple change. Basically we need to change the library the data is found in from "OUR20DATA" to "OUR30DATA". This is very time consuming as we have done this in the past. Now with more users and more queries we are looking for a way to automate the data library change process. Is there a command or function that can be used to develop an application to do this? Thanks in advance

Software/Hardware used:
i-series V6R1M0

Answer Wiki

Thanks. We'll let you know when a new response is added.

I realize that this may be a little late and you may have already finished this project, but I stumbled on this link and thought you might be able to modify it to suit your needs.

http://search400.techtarget.com/tip/Retrieve-query-source

Discuss This Question: 9  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

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
  • TomLiotta
    I assume you mean Query for i5/OS queries. AFAIK, interactive is the only means that I am aware of. (That's one of the reasons I've advocated converting to QM queries for so many years.) Interactive means do it by hand or do it by some means of manipulating interactive sessions. That's not very satisfactory, but it's the way that tool works. If it hasn't changed in the past 20 years, I suspect IBM won't change it any time soon. A PC macro is one possibility. Another might be via virtual terminal APIs, but coding against a telnet API might be more reasonable. Albert York's TNAPI might be useful. This has been a question asked by many for many years, and I've never seen a good answer. Maybe someone else has one by now. Tom
    125,585 pointsBadges:
    report
  • Splat
    Would it be possible to wrap a program around the queries that forces the library list?
    7,455 pointsBadges:
    report
  • ToddN2000
    The main issue is we have a bunch of production queries but mostly the bulk of the problem is the ones created by users. Some have upwards of 75, those employees are in the finance area. Counting the total number of queries by users, programming staff and production we are looking at 5,313. So when our sofware provider send a new release of the software and changes the production library name we have to change all the queries.
    13,050 pointsBadges:
    report
  • TomLiotta
    Counting the total number of queries by users, programming staff and production we are looking at 5,313. ... So when our sofware provider send a new release of the software and changes the production library name we have to change all the queries. I'd consider that as a critical reason to get everyone into using QM queries ASAP. Don't allow any new queries to be created using the old query product, convert as many old queries as possible to QM using automated means, and start converting all remaining ones by hand. Note that all old queries will continue to work as they always did. Tom
    125,585 pointsBadges:
    report
  • Yorkshireman
    Are you able to install your new software to OUR20DATA, or are file formats changing? - rename your exisitng data to something else, and place the new stuff into the old library name. Maybe you can use OURDATA, and only ever use this for production data. Have you discussed this with the vendor? Its a bit arrogant to dictate the data library name. What if you have 2 companies co-exisiting in the same partitioin? - how would they handle it? Is the library name set in a data area, for instance - a technique many package vendors use?
    5,580 pointsBadges:
    report
  • Modiyooch
    what if you create logical files in your old library that point to the production files in the new library? How many of the 5313 queries are actually used?
    540 pointsBadges:
    report
  • TomLiotta
    As of V5R4, you should be able to run a SQL CALL like this:
    CALL QSYS2/Print_Query_Definition( 'mylib', 'myqry', 1)
    That will create a spooled file of the query named 'myqry' in library 'mylib'. The CALL can be run in a batch job for each query. The spooled files could be combined into a single file. A spooled printout of the query definition isn't particularly useful unfortunately. The format isn't very helpful to any automated process because of its complexity. Further, it still doesn't give any useful way of modifying/recreating the *QRYDFN object. But there is an additional possibility -- Query 400 Discovery Tool. I think another thread mentioned it here a couple weeks. (Thanks to the poster of that!) The extended Tool still doesn't help in actually modifying/recreating *QRYDFN objects, but it might help in eliminating a lot of work. It might also help in any conversion effort to get to Query Manager queries. Tom
    125,585 pointsBadges:
    report
  • DanTheDane
    The RUNQRY command has parameter WRYFILE which overrides what is inside the Query400 query. Thus it is possible to create a CL-pgm with the RUNQRY command to execute a Query400 query with an override to your new libraryname. rgds DanF
    2,555 pointsBadges:
    report
  • DanTheDane
    Sorry, "WRYFILE" in my prev post shall be "QRYFILE" DanF
    2,555 pointsBadges:
    report

Forgot Password

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

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

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

Thanks! We'll email you when relevant content is added and updated.

Following