AS/400 Data area

40 pts.
Tags:
AS/400
AS/400 jobs
COBOL
How to share the Data area for twojob, I have a COBOL program which submit the Purge job for one table, that table has so many records. So in turn, it submits so many jobs  for purge the same table but the job which submit first lock the data area, so the next jobs has been ended with error. Now I want to submit multiple jobs for purging due to rec count in that table is large. Also I have one question: If we submit multiple job is there may be a chance for record lock? Can anyone help me in this? Thanks in advance.

Answer Wiki

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

Obviously you cannot have one program lock the *DTAARE and expect other programs to work if they need it. Change your program to to release after every use. Then the programs can take turns using it.

I’m not sure what you are trying to do, but it sounds like you need to do an analysis and perhaps change your overall logic.

Discuss This Question: 4  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 don't understand the question. The question title refers to a "data area" and the text mentions that a data area is locked, but there is no mention of what problem is created by the lock.

    The only actual question asks about a "record lock", but record locks are not related to data areas. And of course record locks can happen between multiple jobs. Whenever two (or more) jobs want to update the same record at the same time, a lock will be applied by the first job that can get the record. Until that job releases the record, no other updates can be allowed. If that didn't happen, databases would quickly get very messed up.

    Your final question asks for help, but it's not clear what help you need.

    Tom

    125,585 pointsBadges:
    report
  • ToddN2000
    Are you purging from multiple tables or a single table multiple times? If multiple tables then record locks should rarely occur. Run you jobs in a single threaded JOBQ and it won't happen. If you are running multiple purges on the same table, you may need re-think your purge logic. Last question, why is a data area being used for a purge process? If you are using it to feed data to a second job, why not create a work file instead? If you need to lock the file during the purge process, wrap it in a CL program and use the ALCOBJ command.
    15,605 pointsBadges:
    report
  • 12we
    Thanks for all ,

    my problem is ,i have 3 tables to purge i have a CL program which submits the puge job separately for this three tables , for every table i have a CL program in tht i have locked the dataarea inorder to allow only one job is active it will call the cobol pgm for purge process , one this purge job done in my cobol pgm i have set my PURGE-COMPLETE flag as "TRUE" , what my main CL program does it will contiously submit the job (to purge this table ) but until the first job complete the second job can't acqure this data area , here i have q 2 question 1. how to submit 2 job for purging single table ( i need to do this coz the record count is huge) , if i allocate thte dataarea in shared update mode , can this be used by manyjob? , if i submit two job for purging single table will it cause record lock??
    40 pointsBadges:
    report
  • TomLiotta

    how to submit 2 job for purging single table ( i need to do this coz the record count is huge) , if i allocate thte dataarea in shared update mode , can this be used by manyjob?

    It can be used by many jobs, but it depends on what you mean by "used". The CHGDTAARA command uses a *SHRUPD (shared for update) lock automatically. And how does a huge record count affect your jobs?

    if i submit two job for purging single table will it cause record lock?

    Maybe. Maybe not. If two jobs try to update the same record at the same time, then, yes, a record lock conflict will appear. If they always access different records, then, no, there won't be conflicting locks. (Record locks always happen when records are changed. The locks just don't always affect other jobs.)

    For almost all cases, we'd have to see the program code before we could know if locks will be a problem.

    In any case, at some points you're asking about data area locks (object locks). And at other points, you're asking about record locks. Although the locks have a lot of things in common, they're not exactly the same between those two. An object lock is different from a record lock.

    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