Chapter Contents

Previous

Next
COPYSAS Autocall Macro

COPYSAS Autocall Macro



Parses the log created by invoking the SAS System with the RTRACE and RTRACELOC log system options that are specified, and creates a copy script


Syntax
Details
Using %COPYSAS to Create a Scaled-Down Copy of the SAS System

Syntax

%COPYSAS(copydir, rtracelog, cpcmd, scriptloc, mkcmd)

copydir
specifies the destination directory to use as the SAS root directory for the copied files. You can specify copydir as a local directory (for example, c:\mysas) or as a network path (for example \\server\share\pubsas). You must specify the copydir.

rtracelog
specifies the location of the log file created by using the RTRACE and RTRACELOC system options. Because you use the RTRACELOC system option to specify where to store the log, you should specify the same value for rtracelog as you did for the system option. You must specify the rtracelog.

cpcmd
specifies the DOS copy command to use. If you omit this argument, the default command is copy /v. If the command you specify requires options, you can specify them in the usual way; that is, separate them from the command with a forward slash (/) or a hyphen (-).

scriptloc
specifies the path and name of the file to which to write the copy script. If you do not specify this argument, the default is COPYSAS.BAT and is placed in the SASUSER subdirectory.

mkcmd
specifies the DOS make directory command to use. If you omit this argument, the default command is mkdir. If the command you specify requires options, you can specify them in the usual way; that is, separate them from the command with a forward slash (/) or a hyphen (-).

Note that you specify values for all arguments without quotes.


Details

The COPYSAS autocall macro parses a log that you create by running the SAS System with the RTRACE and RTRACELOC system options specified. The log contains a record of every file that was used during the SAS session. As it parses the log, the COPYSAS macro builds a copy script (as a DOS batch file) to facilitate copying these files to another destination. This allows you to create a scaled-down copy of the SAS System, optimized for a particular use, such as running a SAS/AF application.

Note:   The COPYSAS macro itself does not create a scaled-down copy of the SAS System; it only creates a DOS batch file that allows you to create the scaled-down copy. The batch file contains the commands to create destination directories and copy files to the destination you specify.  [cautionend]

CAUTION:
Thoroughly test any scaled-down configuration of the SAS System that you create. To ensure that all of the necessary file resources are recorded, you must traverse every path in your SAS session that an end user of the scaled-down configuration should be able to traverse. (If you are running a SAS/AF application, you should exercise every possible path, including error conditions.) Otherwise, you might fail to include a necessary file in your run-time version of the SAS System. If you do not include all of the necessary files in your scaled-down copy of the SAS System, you might get unexpected results from your SAS application.  [cautionend]

If you want to omit the optional arguments and use their default values, you can do so; but you must specify a comma separator as a placeholder for the argument. For example, if you want to use the default copycmd and scriptloc but use md to create directories, your call would look like

%copysas(d:\sasjr, c:\sas\filelist.log,,,md)

You do not have to provide the commas if no arguments follow the last argument you provided. For example, the following invocation is valid:

%copysas(d:\sasjr, c:\sas\filelist.log)

Note:   Keep in mind that the configuration files that you copy (such as any SAS configuration files and the AUTOEXEC.SAS file) are probably customized for your installation and might not be usable on the scaled-down copy without some modifications. Check to make sure that the options in these files reflect the configuration that you want to convey to another user.  [cautionend]

For a complete description of how to create a scaled-down copy of the SAS System using the RTRACE and RTRACELOC system options in conjunction with the COPYSAS macro, see Creating a Scaled-Down Version of the SAS System for Distribution.


Using %COPYSAS to Create a Scaled-Down Copy of the SAS System

Suppose that in a previous SAS session, you used the RTRACE and RTRACELOC system options to create a log of files used during the session. For example, you might have invoked the SAS System with the options

-rtrace all -rtraceloc 
             c:\sas\sasuser\filelist.log

In a subsequent SAS session (in which you do not specify these options), you can use the COPYSAS macro to create a copy script COPYSAS.BAT. For example, if you submit the following statement:

%copysas(c:\mysas,c:\sas\sasuser\filelist.log)
the COPYSAS macro parses C:\SAS\SASUSER\FILELIST.LOG and creates the DOS batch file C:\SAS\SASUSER\COPYSAS.BAT.


Chapter Contents

Previous

Next

Top of Page

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