SAS 9.1.3 Integration Technologies » Developer's Guide


Publish Package Interface
Publish/Retrieve Encoding Behavior
Publishing Packages
INSERT_CATALOG
INSERT_DATASET
INSERT_FDB
INSERT_FILE
INSERT_HTML
INSERT_MDDB
INSERT_PACKAGE
INSERT_REF
INSERT_SQLVIEW
INSERT_VIEWER
PACKAGE_BEGIN
PACKAGE_END
PACKAGE_PUBLISH
LDAP Channel Store Syntax
SAS Metadata Repository Channel Store Syntax
Retrieving Packages
COMPANION_NEXT
ENTRY_FIRST
ENTRY_NEXT
PACKAGE_DESTROY
PACKAGE_FIRST
PACKAGE_NEXT
PACKAGE_TERM
RETRIEVE_CATALOG
RETRIEVE_DATASET
RETRIEVE_FDB
RETRIEVE_FILE
RETRIEVE_HTML
RETRIEVE_MDDB
RETRIEVE_NESTED
RETRIEVE_PACKAGE
RETRIEVE_REF
RETRIEVE_SQLVIEW
RETRIEVE_VIEWER
Filtering Packages
Publishing Examples
Publishing in the Data Step
Publishing in a Macro
Publishing with FTP
Publishing Framework

INSERT_FILE

Inserts a file into a package.

Syntax

CALL INSERT_FILE(packageId, filename, filetype, mimeType, desc, nameValue, rc);

packageID
Numeric, input.
Identifies the package.

filename
Character, input.
Names the file, using the following syntax:
  • FILENAME: external_filename
  • FILEREF: sas_fileref

filetype
Character, input.
Specifies the file type, which must be TEXT or BINARY.

mimeType
Character, input.
Specifies the MIME type, the value of which is determined by the user. Subscribers can filter packages based on MIME type. See Details below for suggested values.

desc
Character, input.
Describes the file.

nameValue
Character, input.
Identifies a list of one or more space-separated name/value pairs, each in one of the following forms:

  • name
  • name=value
  • name="value"
  • name="single value with spaces"
  • name=(value)
  • name=("value")
  • name=(value1, "value 2",... valueN)

Name/value pairs are site-specific; they are used for the purpose of filtering.

rc
Numeric, output.
Receives a return code.

Details

The mimeType parameter is a user-specified MIME type that specifies the type of binary file or text file that is being published. Users might choose to document the supported values in order for publishers to use them or to use their own content strings.

Suggested MIME types include the following:

  • application/msword
  • application/octet-stream
  • application/pdf
  • application/postscript
  • application/zip
  • audio/basic
  • image/jpeg
  • image/gif
  • image/tiff
  • model/vrml
  • text/html
  • text/plain
  • text/richtext
  • video/mpeg
  • video/quicktime

The following example supplies a content string of Image/gif to provide more information about the type of binary file that is being inserted.

   filename = 'filename:/tmp/Report.gif';
   filetype ='binary';
   desc = 'Report information';
   nameValue = '';
   mimetype = 'Image/gif';
   CALL INSERT_FILE(packageId, filename, filetype, 
      mimetype, desc, nameValue, rc);

See Also