Chapter Contents

Previous

Next
SAS/AF Software: Class Dictionary

Using the SAS External File Class

You can create a SAS External File object. When you instantiate a SAS External File object, only the object identifier is created. You then add information about a SAS external file to the object. This step is referred to as initializing the object. To initialize a SAS External File object, use the _setup method. This example initializes the SAS External File object, EXTFILEOBJ, to a UNIX file, $HOME/file:

cateclass=loadclass
          ('sashelp.fsp.extfile.class');
extfileobj=instance(cateclass);

   /* The way you specify the path for an */
   /* external file is host specific.*/
fileref=' ';
filename(fileref, '~/file');
call send (extfileobj, '_setup_', fileref);

Alternatively, you can use _assign to allocate the fileref and initialize the SAS External File object:

cateclass=loadclass
          ('sashelp.fsp.extfile.class');
extfileobj=instance(cateclass);

   /* The way you specify the path for an */
   /* external file is host specific.  */
call send (extfileobj, '_assign_', 'exfile', 
           '~/file');

Note:   Unless an example includes LOADCLASS, INSTANCE, and _setup, the example assumes that you have instantiated a SAS object and initialized it.  [cautionend]

If you list the contents of EXTFILEOBJ, you see

( _class=2621
  DESC='SAS Extfile Class'
  PATH=( 'home-directory/file'
       )[2639]
  ATTRIBUTES=()[2641]
  NAME='EXFILE'
  ENGINE=''
  TYPE='FILE'
  CASE='M'
 )[2635]


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.