Previous Topic
Table Of Contents
Parent Topic
Next Topic

The SWSFSET Function

Related Topics

Web Server API Function Index


May be used in Shadow/REXX
May be used from Other REXX interpreters
High Level language interface is available

SWSFSET is a high level function used to modify file attributes for files sent to the server in a Post operation.

File attributes can be examined using the built-in variables WWW.FILE.N.FILENAME, WWW.FILE.N.HTTP_CONTENT_LENGTH, WWW.FILE.N.NAME, WWW.FILE.N.HTTP_CONTENT_TYPE, WWW.FILE.N.TOEBCDIC, and WWW.FILE.N.FLAGS.

  • The value for FLAGS are set based on the CONTENT-TYPE header sent with the file.
  • The value for TOEBCDIC are set based on the default translate table defined at startup.

These attributes can be changed with the SWSFSET function, but this will NOT change the build-in variable values.

 

SWSFSET Syntax

The SWSFSET function takes three arguments. The invocation format for SWSFSET is:


      Z = SWSFSET(file, attribute, value)
file
Specifies the file number to be modified. The number must be between 1 and the number returned by a previous SWSFCNT() call.
 
attribute
Specifies the name of the attribute to be modified. Currently, there are only two supported attribute values "FLAGS", and "TOEBCDIC". Any other argument value will return an error.
 
value
Specifies the value for the attribute to be changed.
 
  • If the attribute is "FLAGS", the valid values are 0 and 1, where 0 indicates not to translate the data from ASCII to EBCDIC.
  • If the attribute is "TOEBCDIC", the value must be a character string up to 4-bytes long, describing the name of a translate table.

Return Values

SWSFSET always returns a numeric value. A zero return value indicates a successful call. A nonzero return value indicates a failure.

The SWSFSET operation is logged to the Server's wrap-around trace file with the arguments and resulting return value.

 

Example

The first call will change the translate table to "ENU " for US-English translation. The second call will force translation to take place. Subsequent logic would process the files.


/*WWW  /testswsfset
/*REXX
Z = SWSFSET(1, "TOEBCDIC", "ENU ")
Z = SWSFSET(1, "FLAGS", 1)

 


Top