*X Mnemonic / Print Channel Timing Question

Started by Jeffrey Ferreira, March 07, 2023, 10:16:30 AM

Previous topic - Next topic

Jeffrey Ferreira

Hi All,

i'm trying to use *X mnemonic to print  to a text file and email to customer.
But i noticed that when I enter the call entry point the file is still open and locked for that matter.
I added another close inside of the call routine and that worked (i could access file).
But is this correct / good practice?

Jeff


Allen Miglore

This aligns with the documentation. I found that the behavior changed way back at pvx 6.

'*X' (asterisk X) contains the pathname of a program to CALL on the closing of a channel. When a file is closed, PxPlus issues a CALL to the program/entry point specified by the contents of '*X'. This takes place just prior the file being actually being closed, allowing the program to alter the contents of the file if desired.

Jeffrey Ferreira

Hi Allen,
thank you.
so closing the file (again) is not forbidden or bad.
jeff

Mike King

Jeff

No, you can safely close the file in your *X logic.  The system checks for this and handles it appropriately. 
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Jeffrey Ferreira