*RRN issue

5 pts.
Tags:
AS/400
RRN
Hi, I have a program that submits multiple threads. In each thread job, I read a file by IOVRDBF with start position *RRN specified in the parameter of the job. But I could find that in the second job submitted the RRN number given is 298 but the file reads from 297th position. Can't understand from the joblog what's the issue. Please help why is it behaving so. Sample code:
OVRDBF FILE(CVOBSOB) TOFILE(CVOBSOB) POSITION(*RRN +
&RRNC) OVRSCOPE(*JOB) SEQONLY(*YES)
READ:
RCVF
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(NEXT))

CHGVAR VAR(&W1LIB) VALUE(' ')
CHGVAR VAR(&W1BKLIB) VALUE(' ')
/* Process only allocated records for this thread */

IF COND(&RRN *GT &ERRN) THEN(GOTO CMDLBL(NEXT))
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 3  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
    RRN includes deleted records, that may throw off your count?
    54,090 pointsBadges:
    report
  • TheRealRaven
    There's no way to tell anything from the code. It doesn't show values of any variables, nor how the program was called, nor how it was determined that RRN(297) is being read instead of RRN(298).

    As philpl1jb said, a deleted record somewhere before RRN(298) can make it appear as if RRN(297) is being read. That would happen if you're counting records rather checking actual RR Ns.
    35,660 pointsBadges:
    report
  • ToddN2000
    You said it's running multiple threads. Is it possible another thread could be changing the RRN you are expecting? What does the job do?
    133,790 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.

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

Following

Share this item with your network: