[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 959
  • Last Modified:

locked query in AS400


I've been asked to find out why we get an error message when trying to acces a query in AS400.
The error message is this one : "Query &1 in &2 in use, cannot be shared"

I don't have much experience with AS400 so I don't even know what is the first step to take to verify the locks on the query or on the job or anything like that.

2 Solutions
To check the locks, use the Work with Object Locks (WRKOBJLCK) command:

Post back any questions
Gary PattersonVP Technology / Senior Consultant Commented:
This just means that another use has the query open in WRKQRY and is in the process of modifying it.  Barry's instructions will help you find the job that is holding the lock so you can contact the user and ask them to exit the query.  IF you just end the job, their changes will be lost.

- Gary Patterson
Gary is correct.

The rest of the message says:

Cause . . . . . :   The definition for this query is currently being created,
  changed, copied, or used in some way so that it cannot be shared at this

Gary's wording is a real-life phrasing.

It's odd, though, that you used the raw message text in your question. Do your users actually see the "&1" and "&2" in the message when it appears? Or did you locate the QQRYMSG message file and look at the message definition?

If your users are seeing the 'raw' message, then there's something else somewhere that should be considered.

vanroybelAuthor Commented:
Thanks for the help. The query worked a bit later it was because of a network problem.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now