AS/400 handling Data Area

230 pts.
Tags:
AS/400
AS/400 jobs
PSDS
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.

Entry
Explanation

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.

S

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

U

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.

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
  • 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. 
    49,720 pointsBadges:
    report
  • 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.

    9,690 pointsBadges:
    report
  • 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. 

    230 pointsBadges:
    report
  • 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.

    230 pointsBadges:
    report
  • 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

    http://itknowledgeexchange.techtarget.com/itanswers/who-is-using-an-as400-file/

    or

    http://publib.boulder.ibm.com/pubs/html/as400/v4r5/ic2924/index.htm?info/apis/qwclobjl.htm

    or

    http://archive.midrange.com/rpg400-l/200202/msg00344.html

     

     

     

    49,720 pointsBadges:
    report
  • 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.

    8,010 pointsBadges:
    report
  • 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.

    Tom

    125,585 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