Jump to page titleUNITED STATES
hp.com home products and services support and drivers solutions how to buy
» contact hp

:

more options
 

hp.com home
End of Jump to page title
Example-PLI Modify FOP Field In The FAB Using A User_open Routine
Jump to content



» 

business support center

Home & Home Office Support:
» HP branded products
» Presario branded products
» Services & Warranties
Small & Medium Business Support:
» Small & Medium Business products
» Small & Medium Business services
Support for IT Professionals:
» Enterprise products (IT Resource Center)
» NonStop enterprise products
» Business & IT Services
Content starts here
Copyright (c) Digital Equipment Corporation 1992. All rights reserved
PRODUCT:  VAX PLI                             OP/SYS:  VMS

SOURCE:     Digital Customer Support Center

OVERVIEW:

This program demonstrates using the USER_OPEN clause of the ENVIRONMENT
attribute of the OPEN statement to change a bit setting in the FAB for
that file.  In particular, the deferred write bit in the fab$l_fop field
is turned on.


*** CAUTION ***

This sample program has been tested using VAX PLI, version 3.4 on VMS,
version 5.5.  However, we cannot guarantee its effectiveness because of
the possibility of error in transmitting or implementing it.  It is
meant to be used as a template for writing your own program, and it may
require modification for use on your system.


PROGRAM NOTES:

    References:
        "VAX PL/I User Manual", v3.0, paragraph 7.2.54 on pg 7-62, etc.
        "VMS RMS manual", April 1988, paragraph 5.16, pg 5-14.

Note: Normally the DEFERRED_WRITE attribute of the ENVIRONMENT clause
in the OPEN statement would be used to accomplish this.  The purpose here
is simply to show how the fab could be modified.

The simplest way to really verify that this worked is to use SDA
(System Dump Analyzer) on a second process of the same system.  Note
that CMKRNL is required in order to be able to use SDA.  After doing
the SET PROCESS to the appropriate process, do a SET RMS=FAB, then a
SHOW PROC/RMS.  Continue this display to the proper file then observe
the FOP field coding.  This assumes, of course, that the program has
been halted after the OPEN and before the CLOSE of the file - normally
accomplished by stepping through the code with the debugger.


PROGRAM:

usropn: proc options(main);

dcl eof bit(1) aligned;
dcl 1 data_record,
      2 inkey char(5),
      2 chardata char(10);

/* this specifies a relative file. ref UM 6-12, 6-26 */
dcl idxfile file keyed direct;

usropnrtn: proc(fab,rab,open_flag) returns (fixed bin(31));

%include $fabdef;
%include $rabdef;
%include $xabkeydef;
%include $rmsdef;
%include $stsdef;
%include sys$open;
%include sys$create;

dcl 1 fab like fabdef;
dcl 1 rab like rabdef;
dcl 1 xab like xabkeydef;
dcl open_flag fixed bin(31);

if ^fab.fab$v_dfw
   then put skip list ('DFW bit originally set off');

fab.fab$v_dfw = '1'b;    /* now turn it on. */

if (open_flag = 1)
   then sts$value = sys$open (fab,,);
   else sts$value = sys$create (fab,,);

return (sts$value);
end usropnrtn;

open file(idxfile) update title('IDX.DAT')
       environment(user_open(usropnrtn));
inkey = '00003';
chardata = 'cccccccccc';
write file(idxfile) from(data_record) keyfrom(inkey);
close file(idxfile);

end usropn;



buy online or call 1.800.AT.COMPAQ
privacy statementusing this site means you accept its terms