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 Using $FILESCAN To Parse A File Specification
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 1988. All rights reserved
LAYERED PRODUCT: PLI V3.1     OP/SYS: VMS V5.0

SOURCE:     Digital Customer Support Center

OVERVIEW:

This program demonstrates how to call the system service SYS$FILESCAN
to parse a file specification.  In addition, it shows how to call the
RTL routine STR$COPY_R.


CAUTION:  This sample program has been tested using:

    PRODUCT: PLI V3.1 on OPERATING SYSTEM: VMS V5.0

However, we cannot guarantee its effectiveness because of the
possibility of errors 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:

This program calls SYS$FILESCAN to parse the file specification given.
The address of each component is returned in the COMPADDR field.  The
Run Time Library Routine STR$COPY_R is then used to translate this
address into a string descriptor that can be used by the program for
printing purposes.


PROGRAM SAMPLE:

Filescan: procedure options(main);

%include $stsdef;
%include $ssdef;
%include $fscndef;
%include sys$filescan;
%include str$copy_r;

dcl labelname(7) char(16) init('Full file spec: ',
            'NODE:           ','DEVICE:         ','DIRECTORY:      ',
            'NAME:           ','TYPE:           ','VERSION:        ');
dcl sourcestr char(63)
        init('THENODE::DISK1:[MYDIR.PLI]PLIEXAMPLE.PLI;1');
dcl deststr char(63);
dcl outstr char(255) var;
dcl i fixed bin(31);
dcl orgaddr fixed bin(31);
dcl destlen fixed bin(15);
dcl 1 item_list,
      3 item1(7),
        5 complen     fixed bin(15),
        5 itemcode    fixed bin(15),
        5 compaddr    fixed bin(31),
      3 terminator    fixed bin(31) init(0);

itemcode (1) = fscn$_filespec;
itemcode (2) = fscn$_node;
itemcode (3) = fscn$_device;
itemcode (4) = fscn$_directory;
itemcode (5) = fscn$_name;
itemcode (6) = fscn$_type;
itemcode (7) = fscn$_version;

sts$value = sys$filescan(sourcestr,item_list,);
if ^sts$success
   then signal vaxcondition(sts$value);

do i = 1 to 7;
   if complen(i) > 0
     then do;
          orgaddr = compaddr(i);
          destlen = complen(i);
          sts$value = str$copy_r(deststr,destlen,value(orgaddr));
          if ^sts$success
              then signal vaxcondition(sts$value);
          outstr = substr(deststr,1,destlen);
          put skip edit(labelname(i),outstr)(a,a);
     end;
end;

end;





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