AS/400 handling Data Area

250 pts.
AS/400 jobs
I have used data area name count for randomly generating sequence number but I can't use two screen simultaneously. Its giving me run time error data area allocate to other job. I need to handle it through PSDS how could it done?

Answer Wiki

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

Check your definition:

U in ol 23 will LOCK the data area when the program STARTS and release the data area when it ends.

From the book:

VisualAge RPG Language Reference

Position 23 (Type of Data Structure)

This entry is used to identify the type of data structure being defined. If a data structure is not being defined, this entry must be left blank.



The data structure being defined is not a program status or data-area data structure; or a data structure is not being defined on this specification.


Program status data structure. Only one data structure may be designated as the program status data structure.


Data-area data structure. The data area is retrieved at initialization and is rewritten at the end of the program:

  • If the DTAARA keyword is specified, the parameter to the DTAARA keyword is used as the name of the external data area. If the name is a variable, the value must be set before the program begins. This can be done by:
    • Passing the variable as a parameter.
    • Explicitly initializing the variable with the INZ keyword.
    • Sharing the variable with another module using the IMPORT and EXPORT |keywords, and ensuring the value is set prior to the call.
  • If the DTAARA keyword is not specified, the name in positions 7-21 is used as the name of the external data area.

Good Luck!PGMBOB 

Discuss This Question: 7  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.
  • philpl1jb
    I'm confused about the question .. the PSDS will allow you to determine the source of the error but not resolve it.  It sounds like your code keeps a data area locked that you don't need locked and therefore other programs cannot get the data area.  Look at methods to unlock a data area. 
    54,090 pointsBadges:
  • ToddN2000

    Is your data area being locked by a CL program? Check your RPG code for the data area.

    How do you get the data?

    How is it updated?

    How are you closing / releasing the data area?

    If you still have issues, post your code for the data area and we can try and help.

    133,675 pointsBadges:
  • Nikrajpapa

    i want to handle this data area lock error through PSDS will it be possible?

    if not then wht is the other way to handle it.

    i am using RPGLE program in that i am using IN and out opcode to update the data area.

    *lock IN Count

    add 1 no.

    out count

    if one program lock my data area then i just need to handle that run time error in other programs to avoid that rau time error. 

    250 pointsBadges:
  • Nikrajpapa

    if data area lock by perticular program then i want show jst window that try after sometime that data area lock by so and so..\

    what is the way for that.

    250 pointsBadges:
  • philpl1jb

    Yes .. in you have the operaton

    IN (e)

    if %Error ...

    you will be able to detect that an error has occurred.

    You can get some of the error info from the PSDS but you will need to get the name check out this link






    54,090 pointsBadges:
  • BigKat

    if you ALWAYS *lock in, add 1, and out the data area, you shouldn't get object locks, as the first program will release it before the other program times out on its *lock in.

    check your programs for one that is not doing the *lock in, add 1, and out consecutively (especially if there is user action occurring before the out.

    9,460 pointsBadges:
  • TomLiotta

    Personally, I'd stop using the data area altogether. Use something designed for sequence numbers, e.g., use a SQL SEQUENCE object or something else that's more useful for the purpose.

    Why try to handle a problem when you can just eliminate the problem? Or perhaps you need to describe why you're stuck with the problem at all.


    125,585 pointsBadges:

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.

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


Share this item with your network: