fixunix
Tags Register FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

RCVF commad problem - IBM AS400

This is a discussion on RCVF commad problem - IBM AS400 ; Hi. I've just written simple CL which looks like this: PGM DCLF FILE(MYLIB/DGSTS) ALWGRAPHIC(*YES) LOOP: DLYJOB DLY(5) DLTF MYLIB/DGSTS MIMIX/WRKDG DGDFN(LIMSP) STATUS(*NO) OUTPUT(*OUTFILE) + OUTFILE(MYLIB/DGSTS) MONMSG MSGID(LVE3019) EXEC(GOTO CMDLBL(LOOP)) RCVF MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(ENDPGM)) IF COND(&DBAPYBKLG *EQ 0) THEN(GOTO LOOP) ...


Fix Unix > Technologies & Tools > Systems > IBM AS400 > RCVF commad problem

Reply
 
LinkBack Tools
  #1  
Old 04-15-2008, 06:57 AM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default RCVF commad problem

Hi.

I've just written simple CL which looks like this:

PGM

DCLF FILE(MYLIB/DGSTS) ALWGRAPHIC(*YES)
LOOP: DLYJOB DLY(5)
DLTF MYLIB/DGSTS
MIMIX/WRKDG DGDFN(LIMSP) STATUS(*NO) OUTPUT(*OUTFILE) +
OUTFILE(MYLIB/DGSTS)
MONMSG MSGID(LVE3019) EXEC(GOTO CMDLBL(LOOP))
RCVF
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(ENDPGM))
IF COND(&DBAPYBKLG *EQ 0) THEN(GOTO LOOP)
CRTLIB LIB(xxx)
GOTO CMDLBL(LOOP)
GOTO CMDLBL(ENDPGM)
ENDPGM: ENDPGM

problem is that program runs once, so command MIMIX/WRKDG creates
table MYLIB/DGSTS
then check if one of fields value is equal 0 and tries to run again
but it can't perform DLTF command
because DGSTS table is locked, also second run of MIMIX/WRKDG goes
wrong because of that lock.

Can I release my DGSTS file after I check if '&DBAPYBKLG *EQ 0' to be
able to run LOOP again ?


Tomasz
Reply With Quote
  #2  
Old 04-15-2008, 07:11 AM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default Re: RCVF commad problem

one more thing, lock looks like:

Member Job User Number Type Lock
Status Scope Thread
DGSTS QPADEV000F CWTOST 132889 DATA *SHRRD
HELD *JOB

so I've added DLCOBJ OBJ((MYLIB/DGSTS *FILE *SHRRD))

unfortunatelly it didn't remove lock so I can't delete that file


Tomasz



On 15 Kwi, 08:57, tomasz wrote:
> Hi.
>
> I've just written simple CL which looks like this:
>
> PGM
>
> DCLF FILE(MYLIB/DGSTS) ALWGRAPHIC(*YES)
> LOOP: DLYJOB DLY(5)
> DLTF MYLIB/DGSTS
> MIMIX/WRKDG DGDFN(LIMSP) STATUS(*NO) OUTPUT(*OUTFILE) +
> OUTFILE(MYLIB/DGSTS)
> MONMSG MSGID(LVE3019) EXEC(GOTO CMDLBL(LOOP))
> RCVF
> MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(ENDPGM))
> IF COND(&DBAPYBKLG *EQ 0) THEN(GOTO LOOP)
> CRTLIB LIB(xxx)
> GOTO CMDLBL(LOOP)
> GOTO CMDLBL(ENDPGM)
> ENDPGM: ENDPGM
>
> problem is that program runs once, so command MIMIX/WRKDG creates
> table MYLIB/DGSTS
> then check if one of fields value is equal 0 and tries to run again
> but it can't perform DLTF command
> because DGSTS table is locked, also second run of MIMIX/WRKDG goes
> wrong because of that lock.
>
> Can I release my DGSTS file after I check if '&DBAPYBKLG *EQ 0' to be
> able to run LOOP again ?
>
> Tomasz





Reply With Quote
  #3  
Old 04-15-2008, 09:11 AM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default Re: RCVF commad problem

A quick web search suggests that CLOF won't release the lock either
(though you are probably going to need this anyway if you intend to
regenerate and reread the same file again and again), and you should
to split your program in two: PGM1 calls PGM2 which does the RCVF then
ends passing back a parm to PGM1, PGM1 checks the parm returned from
PGM2 and runs the DLTF if required.

If that seems a bit convoluted, why not use *REPLACE as the OUTFILE
option, and just overwrite the file each time?
Reply With Quote
  #4  
Old 04-15-2008, 09:25 AM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default Re: RCVF commad problem


Hi.

WRKDG command has *ADD or *REPLACE option.
Both of them doesn't work with table locked.

So I'll try with PGM1 and PGM2 combination.

Tomasz


On 15 Kwi, 11:11, "walker.l2" wrote:
> A quick web search suggests that CLOF won't release the lock either
> (though you are probably going to need this anyway if you intend to
> regenerate and reread the same file again and again), and you should
> to split your program in two: PGM1 calls PGM2 which does the RCVF then
> ends passing back a parm to PGM1, PGM1 checks the parm returned from
> PGM2 and runs the DLTF if required.
>
> If that seems a bit convoluted, why not use *REPLACE as the OUTFILE
> option, and just overwrite the file each time?





Reply With Quote
  #5  
Old 04-17-2008, 12:22 AM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default Re: RCVF commad problem

You need to create your work file in QTEMP so that the Mimix Object
Replicator doesn't interfere with your work file
"tomasz" wrote in message
news:dd3a6a2b-7241-46b4-b27e-f085f1bbec0e@d45g2000hsc.googlegroups.com...
> Hi.
>
> I've just written simple CL which looks like this:
>
> PGM
>
> DCLF FILE(MYLIB/DGSTS) ALWGRAPHIC(*YES)
> LOOP: DLYJOB DLY(5)
> DLTF MYLIB/DGSTS
> MIMIX/WRKDG DGDFN(LIMSP) STATUS(*NO) OUTPUT(*OUTFILE) +
> OUTFILE(MYLIB/DGSTS)
> MONMSG MSGID(LVE3019) EXEC(GOTO CMDLBL(LOOP))
> RCVF
> MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(ENDPGM))
> IF COND(&DBAPYBKLG *EQ 0) THEN(GOTO LOOP)
> CRTLIB LIB(xxx)
> GOTO CMDLBL(LOOP)
> GOTO CMDLBL(ENDPGM)
> ENDPGM: ENDPGM
>
> problem is that program runs once, so command MIMIX/WRKDG creates
> table MYLIB/DGSTS
> then check if one of fields value is equal 0 and tries to run again
> but it can't perform DLTF command
> because DGSTS table is locked, also second run of MIMIX/WRKDG goes
> wrong because of that lock.
>
> Can I release my DGSTS file after I check if '&DBAPYBKLG *EQ 0' to be
> able to run LOOP again ?
>
>
> Tomasz



Reply With Quote
  #6  
Old 04-17-2008, 08:51 AM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default Re: RCVF commad problem

That won't solve the OP's problem. The lock is not caused by MIMIX,
but by his own CL program. You can't code DCLF .. RCVF ... DLTF in the
same CL program (DLTF fails because RCVF leaves the file open).
Reply With Quote
  #7  
Old 04-17-2008, 09:54 AM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default Re: RCVF commad problem

On Apr 17, 9:51*am, "walker.l2" wrote:
> That won't solve the OP's problem. The lock is not caused by MIMIX,
> but by his own CL program. You can't code DCLF .. RCVF ... DLTF in the
> same CL program (DLTF fails because RCVF leaves the file open).


'Just' put a RCLRSC *CALLER in your program, either after or in place
of the CLOF. This may wel break the rest of the application though.

Jonathan.
Reply With Quote
  #8  
Old 04-18-2008, 12:25 AM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default Re: RCVF commad problem

You are correct i didn't notice the the DLTF was included in the loop.

Which makes the whole discussion moot. This program design is inherently
bad. The OP should use Mimix's RTVDGSTS command instead.

"walker.l2" wrote in message
news:59e07fc1-068a-4ea9-b633-cea6ee29dc7d@s50g2000hsb.googlegroups.com...
> That won't solve the OP's problem. The lock is not caused by MIMIX,
> but by his own CL program. You can't code DCLF .. RCVF ... DLTF in the
> same CL program (DLTF fails because RCVF leaves the file open).



Reply With Quote
  #9  
Old 04-18-2008, 07:40 AM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default Re: RCVF commad problem

Hi.

I was thinking about RTVDGSTS command but all I need is to get vaule
of 'unprocessed entry count' of one of my DG.

I didn't find it in any of RTVDGSTS variables but WRKDG to *outfile
gives me that value.

That's why I decided to use WRKDG and then RCVF to check if value I need
to monitor is 0 or something else.

Perhaps you know which variable in RTV... gives me what I need.

I's working fine now with WRKDG.

Tomasz



Tim M pisze:
> You are correct i didn't notice the the DLTF was included in the loop.
>
> Which makes the whole discussion moot. This program design is inherently
> bad. The OP should use Mimix's RTVDGSTS command instead.
>
> "walker.l2" wrote in message
> news:59e07fc1-068a-4ea9-b633-cea6ee29dc7d@s50g2000hsb.googlegroups.com...
>> That won't solve the OP's problem. The lock is not caused by MIMIX,
>> but by his own CL program. You can't code DCLF .. RCVF ... DLTF in the
>> same CL program (DLTF fails because RCVF leaves the file open).

>
>

Reply With Quote
  #10  
Old 04-18-2008, 10:17 PM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default Re: RCVF commad problem

You should use RTVAPYSTS to determine your backlogs, and RTVDGSTS to
determine if the data group is running

"tomasz" wrote in message
news:fu9jbi$clm$1@atlantis.news.neostrada.pl...
> Hi.
>
> I was thinking about RTVDGSTS command but all I need is to get vaule
> of 'unprocessed entry count' of one of my DG.
>
> I didn't find it in any of RTVDGSTS variables but WRKDG to *outfile
> gives me that value.
>
> That's why I decided to use WRKDG and then RCVF to check if value I
> need to monitor is 0 or something else.
>
> Perhaps you know which variable in RTV... gives me what I need.
>
> I's working fine now with WRKDG.
>
> Tomasz
>
>
>
> Tim M pisze:
>> You are correct i didn't notice the the DLTF was included in the
>> loop.
>>
>> Which makes the whole discussion moot. This program design is
>> inherently bad. The OP should use Mimix's RTVDGSTS command instead.
>>
>> "walker.l2" wrote in message
>> news:59e07fc1-068a-4ea9-b633-cea6ee29dc7d@s50g2000hsb.googlegroups.com...
>>> That won't solve the OP's problem. The lock is not caused by MIMIX,
>>> but by his own CL program. You can't code DCLF .. RCVF ... DLTF in
>>> the
>>> same CL program (DLTF fails because RCVF leaves the file open).

>>


Reply With Quote
  #11  
Old 04-19-2008, 08:16 AM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default Re: RCVF commad problem

tomasz wrote:
> Hi.
>
> I was thinking about RTVDGSTS command but all I need is to get vaule
> of 'unprocessed entry count' of one of my DG.
>
> I didn't find it in any of RTVDGSTS variables but WRKDG to *outfile
> gives me that value.
>
> That's why I decided to use WRKDG and then RCVF to check if value I need
> to monitor is 0 or something else.
>
> Perhaps you know which variable in RTV... gives me what I need.


If you want to use the RTV* commands, you may need to do it using two
commands in a loop. The return variable DBAPYPRC - number of apply
processes - is returned by RTVDGSTS. Then, for each active apply
process for the group, you can return the variable BACKLOG using the
RTVAPYSTS that tells how many entries behind each apply process is.


>
> I's working fine now with WRKDG.
>
> Tomasz
>
>
>
> Tim M pisze:
>> You are correct i didn't notice the the DLTF was included in the loop.
>>
>> Which makes the whole discussion moot. This program design is
>> inherently bad. The OP should use Mimix's RTVDGSTS command instead.
>>
>> "walker.l2" wrote in message
>> news:59e07fc1-068a-4ea9-b633-cea6ee29dc7d@s50g2000hsb.googlegroups.com...
>>> That won't solve the OP's problem. The lock is not caused by MIMIX,
>>> but by his own CL program. You can't code DCLF .. RCVF ... DLTF in the
>>> same CL program (DLTF fails because RCVF leaves the file open).

>>
>>

Reply With Quote
Reply

Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: [Samba] Add printer commad ... unix Samba 0 10-08-2007 02:42 AM
Re: [Samba] Add printer commad ... unix Samba 0 10-08-2007 02:42 AM
Re: [Samba] Add printer commad ... unix Samba 0 10-08-2007 02:41 AM
Re: [Samba] Add printer commad ... unix Samba 0 10-08-2007 02:37 AM
[Samba] Add printer commad ... unix Samba 0 10-08-2007 02:37 AM


All times are GMT. The time now is 09:46 AM.