Previous Page Contents Page Next Page

2.2 COPY_TRACE_TO_FILE

The COPY_TRACE_TO_FILE verb copies the current contents of the API trace file or files to a new file, and clears the trace files. This enables you to save a copy of the current trace data for this application. For more information about API tracing, refer to the SNAP-IX Diagnostics Guide.

All API tracing on this application (for any of the SNAP-IX APIs) must be stopped before you issue COPY_TRACE_TO_FILE. If any tracing is active, use the DEFINE_TRACE verb to stop it before using this verb.

2.2.1 VCB Structure

typedef struct copy_trace_to_file
  {
  AP_UINT16       opcode;             /* Verb identifying operation code.    */
  unsigned char   opext;              /* Verb extension code - reserved.     */
  unsigned char   reserv2;            /* Reserved.                           */
  AP_UINT16       primary_rc;         /* Primary return code from verb.      */
  AP_UINT32       secondary_rc;       /* Secondary (qualifying) return code. */
  unsigned char   reserv3[8];         /* Reserved.                           */
  unsigned char   file_name[64];      /* File name to write to.              */
  unsigned char   file_option;        /* File options. New or overwrite.     */
  unsigned char   reserv4[12];        /* Reserved.                           */
  };

2.2.2 Supplied Parameters

The program using this verb supplies the following parameters:

opcode

SV_COPY_TRACE_TO_FILE

file_name

The name (and optionally the path) of the file to hold the trace information. This name can be up to 64 characters. If the file is not in the current directory, specify the full path; ensure that it is a valid path on any computer to which this verb is issued.

If you set the file_option parameter to SV_NEW, the file name specified must not be the name of an existing file.

file_option

Possible values are:

SV_NEW

Create a new file with the name specified in file_name. An error is returned if this file already exists.

SV_OVERWRITE

Overwrite the file if it exists, or create the file if it does not exist.

2.2.3 Returned Parameters

After the verb executes, SNAP-IX returns parameters to indicate whether the execution was successful and, if not, to indicate the reason the execution was unsuccessful.

Successful Execution

If the verb executes successfully, SNAP-IX returns the following parameter:

primary_rc

SV_OK

Unsuccessful Execution

When a verb does not execute successfully, SNAP-IX returns a primary return code to indicate the type of error and a secondary return code to provide specific details about the reason for unsuccessful execution.

Parameter Check

If the verb does not execute because of a parameter error, SNAP-IX returns the following parameters:

primary_rc

SV_PARAMETER_CHECK

secondary_rc

SV_INVALID_FILE_OPTION

The file_option parameter contained a value that was not valid.

State Check

If the verb does not execute successfully because of a state error, the following parameters are returned:

primary_rc

SV_STATE_CHECK

secondary_rc

Possible values:

SV_TRACE_BUFFER_EMPTY

There was no trace information to copy to file. Either the trace files were empty, or the SNATRC environment variable was not set up. This environment variable must be set up before the application is started. For information about how to control API tracing, refer to the SNAP-IX Diagnostics Guide.

SV_TRACE_NOT_STOPPED

Tracing was still active when the verb was issued. Before issuing COPY_TRACE_TO_FILE, tracing for the CSV, APPC, CPI-C, HLLAPI, and RUI interfaces must be turned off. Use DEFINE_TRACE to turn off any active tracing before issuing COPY_TRACE_TO_FILE; for more information, see DEFINE_TRACE.

Other Conditions

Other conditions can result in the following primary return codes ( primary_rc).

SV_FILE_ALREADY_EXISTS

You specified the value SV_NEW for the file_option parameter (to create a new output file), but a file with the specified name already exists.

SV_INVALID_VERB

The opcode parameter did not match the operation code of any verb. No verb executed.

SV_OUTPUT_DEVICE_FULL

There was insufficient space in the output file's disk or directory to hold the trace information. The trace files were not reset; the output file may contain some of the available trace information, but is not complete.

SV_UNEXPECTED_DOS_ERROR

The operating system has encountered an error while processing the verb. The operating system return code is returned through the secondary_rc . If the problem persists, consult the System Administrator for corrective action.

For the meaning of the operating system return code, refer to the file /usr/include/errno.h.

Previous Page Contents Page Top of Page Next page