In certain circumstances, where the Apache server job doesn’t always end, and a job can run concurrently for multiple users, creating generic files in QTEMP can cause conflicts. For instance, User A could run a process, and User B could also start the same process. In this scenario, both users could have the same job number and therefore they would share QTEMP. Use the method below to avoid this situation in your environment.


Solution

  1. In most cases, the scenario aboveoccurs because a script uses EXECUTE to create a work file that is then used to produce the final results. The solution is to modify the EXECUTE command to create the work file with a unique member name for each user in a library other than QTEMP by adding the member (OUTMBR) parameter with a variable like so:
    SEQUEL/EXECUTE VIEW(LIB/VIEWNAME) OUTFILE(WORKLIB/VIEWNAME)
    OUTMBR(&USER) MBROPT(*REPLACE)


    Define the variable (&USER) like so:
    Type = NAME
    Length = 10
    Prompt text = *noprompt
    Default value = *user
  2. For any other view that uses the work file, specify the member name on the FROM clause like so:
    FROM WORKLIB/VIEWNAME (&USER)
  3. The key to this solution is the user must log onto SWI using a secure sign on. The EXECUTE command will create a member in the work file based on the user profile (they won’t be prompted because of the default value), and avoid a conflict if other users run the same process.

 

 

 

 

 


Still have questions? We can help. Submit a case to Technical Support.

Last Modified On: April 21, 2017