Jeff Crosby wrote:
Isn't the execution of a CHGJRN command to a new receiver supposed to generate a message? (I think it's CPF7020)

No message is generated in the MSGQ assigned to the journal, though there is one generated within the joblog. I'm looking for a way to retrieve the name of the journal receiver that was just detached.


Previous receiver is reasonably easy to determine. A trivial example:

/* Begin paste */

dcl &RcvInfo *char 512

dcl &RcvLen *char 4
dcl &RcvName *char 20
dcl &PrvRcvName *char 20

dcl &ErrCod *char 4 value( x'00000000' )

chgvar &RcvInfo ' '

chgvar %bin( &RcvLen ) 512
chgvar &RcvName 'AUDJRN1703LAUDJRN '


callprc 'QjoRtvJrnReceiverInformation' +
( +
&RcvInfo +
&RcvLen +
&RcvName +
'RRCV0100' +
&ErrCod +

chgvar &PrvRcvName %sst( &RcvInfo 293 20 )
/* Get previous receiver name... */


/* End paste */

The request for receiver info is sent for the receiver named AUDJRN1703 in library LAUDJRN; that name is in variable &RcvName. The content of the returned structure has the 'previous receiver' name and library beginning in position 293 (offset 292) for 20 characters, name and library. That substring is placed into &PrvRcvName.

If you replace the value 'AUDJRN1703LAUDJRN ' with a receiver and library from your system, you should see its preceding receiver in &PrvRcvName in the dump when the program runs.

Of course, you have to determine what the starting (current?) receiver name is...

Tom Liotta

This thread ...

Return to Archive home page | Return to MIDRANGE.COM home page