TRIPsystem Kernel API 8.3
Loading...
Searching...
No Matches
Report Management

Management of reports / output formats. More...

Functions

int TdbCheckOutputFormat (void)
 Check the syntax of an output format.
 
int TdbCopyOutputFormat (char *old_base, char *old_form, char *new_base, char *new_form, int *error)
 Create a copy of an output format.
 
int TdbCurrentForm (char *base, char *form, int mode)
 Retrieve the name of the current defined default entry or output form.
 
int TdbDeleteOutputFormat (char *base, char *format)
 Delete an output format.
 
int TdbGetComment (char *comment)
 Load the description of a CONTROL record.
 
int TdbGetFormLine (char *line, int *lineLength)
 Load a format line.
 
int TdbGetOutputFormat (char *base, char *format)
 Load an output format.
 
int TdbPutComment (char *comment)
 Store the description of a CONTROL record.
 
int TdbPutFormLine (char *line, int lineLength)
 Load a format line into an internal format buffer.
 
int TdbPutOutputFormat (void)
 Store an output format.
 

Detailed Description

Management of reports / output formats.

The TRIP report management functions offer functionality for administration (creation, alteration and deletetion) of reports (a.k.a. output formats).

Function Documentation

◆ TdbCheckOutputFormat()

int TdbCheckOutputFormat ( void  )

Check the syntax of an output format.

Returns
1 or other odd value on success, even value on error

Description

The function TdbCheckOutputFormat() checks the syntax of an output format previously loaded by a call to either the TdbGetOutputFormat() or TdbCopyOutputFormat() functions.

Return Codes

 Code Description Explanation
1 Operation completed successfully The function completed its operations without error.
3394 Format syntax error at or near line lineno.
5218 No initial left delimiter in format spec. Premature end of format specification.
See also
TdbCopyOutputFormat()
TdbGetOutputFormat()

◆ TdbCopyOutputFormat()

int TdbCopyOutputFormat ( char *  old_base,
char *  old_form,
char *  new_base,
char *  new_form,
int *  error 
)

Create a copy of an output format.

Parameters
old_baseName of source database
old_formName of source output format
new_baseName of target database
new_formName of new output format
errorError position
Returns
1 or other odd value on success, even value on error

Description

The function TdbCopyOutputFormat() starts the copying of an output format from one database to another or to a form with a different name within the same database. The calling process must subsequently call the functions TdbCheckOutputFormat() and TdbPutOutputFormat() to store the new format in the CONTROL file.

Parameter Values

The old_base parameter is passed a character string as the name of the source database from which the existing form will be copied.

The old_form parameter is passed a haracter string as the name of the source output format to be copied.

The new_base parameter is passed a character string as the name of the target database design to which the new form will be copied.

The new_form parameter is passed a character string as the name of the new output format to be created by the copy operation.

The error parameter is passed a pointer to an int variable that will receive the positional number of the argument that caused the failure. Valid values are:

Error Value Explanation
0 No errors detected
1 The source database does not exist
2 The source output format does not exist. Alternatively the user calling this function is not owner of the format.
3 The target database does not exist. Alternatively, the user calling this function has no write access to the database
4 The new output format cannot be created. The TRIPkernel detected a parsing error.

Return Codes

 Code Description Explanation
34051 Output format copied. The function completed its operations without error.
7970 Output format {database.format} not found. The specified output format did not exist in the source database.
8066 Already existing output format.
11554 Database name is missing.
15010 1 is a database cluster. The database name passed to the function refers to a database cluster and not a single database.
See also
TdbPutOutputFormat()

◆ TdbCurrentForm()

int TdbCurrentForm ( char *  base,
char *  form,
int  mode 
)

Retrieve the name of the current defined default entry or output form.

Parameters
baseName of database
formName of form
modeMode or type of form.
Returns
1 or other odd value on success, even value on error

Description

The TdbCurrentForm() returns the name of the current defined default entry or output form, as defined by the calling process with the CCL commands DEfine Format= {x} and DEfine EFOrm= {x} .

Parameter Values

The base parameter is passed a character string as the name of the database for which form information is required.

The form parameter is passed a character string to receive a string as the name of the form

The mode parameter is passed an int that defines the type of the current form to retrieve. Valid values are:

Symbolic Constant Constant Value Explanation
CURRENT_OUTPUT 1 Retrieve the current default output form
CURRENT_ENTRY 2 Retrieve the current default entry form

Return Codes

 Code Description Explanation
1 Operation completed successfully The function completed its operations without error.
610 Database {1} not found.
1730 Default data entry form for {1} not specified.
2530 No access to database {1}.
3042 {1} is not a database.
15234 Missing database name.
21666 No default output format defined for {1}.

◆ TdbDeleteOutputFormat()

int TdbDeleteOutputFormat ( char *  base,
char *  format 
)

Delete an output format.

Parameters
baseDatabase name
formatFormat name
Returns
1 or other odd value on success, even value on error

Description

The function TdbDeleteOutputFormat() deletes an output format. A format can only be deleted by the owner of the format or the owner of the database to which the format belongs.

Parameter Values

The base parameter is passed a character string as the database name.

The format parameter is passed a character string as the name of the output format to be deleted.

Return Codes

 Code Description Explanation
1 Operation completed successfully The function completed its operations without error.
7522 Database {2} is OS write protected.
11170 Cannot find COMMAND file {1}{2}{3}
9090 Database {2} is locked by another user, try again later.
11554 Database name is missing.
11586 Output format name is missing.
14722 You are not the creator of {1}{3}{2}
15010 {1} is a database cluster. The database name passed to the function refers to a database cluster and not a single database.
15618 Only alphanumerics/underscores allowed in names.
17474 A TRIP runtime version cannot create databases.
See also
TdbGetOutputFormat()

◆ TdbGetComment()

int TdbGetComment ( char *  comment)

Load the description of a CONTROL record.

Parameters
commentString buffer that receives the description of a CONTROL record.
Returns
1 or other odd value on success, even value on error

Description

The function TdbGetComment() loads the description of a CONTROL record into the buffer provided. The call has to be preceded by a call to one of the TdbCopyOutputFormat(), TdbCopyProcedure(), TdbGetOutputFormat() or TdbGetProcedure() functions.

Parameter Values

The comment parameter is passed a character string as buffer for storing the description of a CONTROL record.

Return Codes

This function always succeeds.

See also
TdbCopyOutputFormat()
TdbCopyProcedure()
TdbGetOutputFormat()
TdbGetProcedure()

◆ TdbGetFormLine()

int TdbGetFormLine ( char *  line,
int *  lineLength 
)

Load a format line.

Parameters
lineFormat line
lineLengthLength of format line
Returns
1 or other odd value on success, even value on error

Description

The function TdbGetFormLine() loads a single line from a format into the buffer provided. The format must have been previously loaded into the internal form buffer by using the TdbGetOutputFormat() function. Repeated calls to TdbGetFormLine() can be made until a status code of zero is returned this allows processing of the complete form.

Parameter Values

The line parameter is passed a character string to receive a line from the selected output format specification.

The lineLength parameter is passed a pointer to an int variable to receive the length of the line to be returned from the output format specification.

Return Codes

 Code Description Explanation
1 Operation completed successfully The function completed its operations without error.
0 No more lines.
See also
TdbGetOutputFormat()

◆ TdbGetOutputFormat()

int TdbGetOutputFormat ( char *  base,
char *  format 
)

Load an output format.

Parameters
baseDatabase name
formatFormat name
Returns
1 or other odd value on success, even value on error

Description

The function TdbGetOutputFormat() loads an output format for the specified database into the internal format buffer for further processing. The output format can only be loaded by the owner of the format or the owner of the database to which the format belongs.

This function is intended primarily for use within the TRIPclassic environment.

Parameter Values

The base parameter is passed a character string as the name of the database for which an output format is to be retrieved.

The format parameter is passed a character string as the name of the format to be retrieved.

Return Codes

 Code Description Explanation
1 Operation completed successfully The function completed its operations without error.
7970 Output format database.format not found. The specified output format did not exist in the source database.
11554 Database name is missing.
11586 Output format name is missing.
14722 You are not the creator of {1}{3}{2}
15618 Only alphanumerics/underscores allowed in names.

◆ TdbPutComment()

int TdbPutComment ( char *  comment)

Store the description of a CONTROL record.

Parameters
commentDescription of CONTROL record
Returns
1 or other odd value on success, even value on error

Description

The function TdbPutComment() stores a description of the CONTROL record previously loaded into the internal buffer. The call has to be preceded by a call to one of the TdbCopyOutputFormat(), TdbCopyProcedure(), TdbGetOutputFormat() or TdbGetProcedure() functions.

Parameter Values

The comment parameter is passed a character string as the description of a CONTROL record.

Return Codes

 Code Description Explanation
1 Operation completed successfully The function completed its operations without error.
See also
TdbCopyOutputFormat()
TdbCopyProcedure()
TdbGetOutputFormat()
TdbGetProcedure()

◆ TdbPutFormLine()

int TdbPutFormLine ( char *  line,
int  lineLength 
)

Load a format line into an internal format buffer.

Parameters
lineLine to load into format
lineLengthLength of line
Returns
1 or other odd value on success, even value on error

Description

The function TdbPutFormLine() loads a single line into the internal output format buffer, which must have been previously loaded with an output format by a call to either of the TdbGetOutputFormat() or TdbCopyOutputFormat() functions.

The first call to TdbPutFormLine() will empty the format buffer and make the supplied line the first line in the format, while subsequent calls append lines to the format. The proper way to modify an existing output format is therefore to first read all lines by repeatedly calling TdbGetFormLine() until it returns an error code, then put each line back (whether it was modified or not) by calling the TdbPutFormLine() function. It is for the application program to provide intermediate storage for the lines. Calls to TdbGetFormLine() and TdbPutFormLine() should not be intermingled.

The functions TdbCheckOutputFormat() and then TdbPutOutputFormat() must be called if the format is to be stored.

Parameter Values

The line parameter is passed a character string as the line to be loaded into the format.

The line length parameter is passed an int as the length of the format line held in the line parameter.

Return Codes

 Code Description Explanation
1 Operation completed successfully The function completed its operations without error.
See also
TdbGetOutputFormat()

◆ TdbPutOutputFormat()

int TdbPutOutputFormat ( void  )

Store an output format.

Returns
1 or other odd value on success, even value on error

Description

The function TdbPutOutputFormat() writes the output format from an internal format buffer into the CONTROL file. The internal buffer must previously have been loaded by a call to either the TdbGetOutputFormat() or TdbCopyOutputFormat() . Furthermore, before the format is committed to CONTROL a syntax check must be performed by a call of the TdbCheckOutputFormat() .

Return Codes

 Code Description Explanation
32643 Format {1} altered for database {2}. The function completed its operations without error.
32675 Format {1} created for database {2}. The function completed its operations without error.
11970 Syntax check of {2}{3}{1} has not been performed
14722 You are not the creator of {1}{3}{2}
17474 A TRIP runtime version cannot create databases.
See also
TdbCopyOutputFormat()
TdbGetOutputFormat()