Print Set Command

You can view the definition of a set using the Print Set command. This command enables you to view all the clauses used to define the set name.

This page discusses:

Syntax

print set NAME [user USER_NAME] [SELECT] [start START_RANGE] [end END_RANGE] 
[dump [SEPARATOR_STR]] [recordseparator SEPARATOR_STR] [tcl] [output FILENAME];
  • NAME is the name of the set you want to view. You can include the User clause if you are a business administrator with person access, or if you have visibility to another user’s set.
  • SELECT specifies the fields you want to print.
  • START_RANGE is inclusive and zero-based.
  • END_RANGE is exclusive and zero-based.
  • SEPARATOR_STR specifies the character or character string that will be used to separate field values from a single business object.
  • FILENAME outputs the results of the command to an external file rather than displaying the information on your output terminal.

When you enter this command, MQL displays the business objects (if any) that make up the set. For example, to see the definition for the set named “Seat Components,” you would enter:

print set “Seat Components”;

Depending on your system setup, names might be case sensitive.

If the set name is not found, an error message will result. If that occurs, use the List Set command to check for the presence and spelling of the set name.

Select Clause

This clause enables you to obtain more information than just the type, name or revision of the object. The Select clause has two forms: Select and Selected.

To first examine the general list of field names, use this command:

print businessobject selectable;

The selectables for sets are the same as for business objects. For more information, see Select Clause. The Selectable clause is similar to using the ellipsis button in the graphical applications—it provides a list from which to choose.

Select From

The following form of the Select clause enables you to list all the field names whose values you want to print.

select [+] FIELD_NAME [ [FIELD_NAME] ... ]

When this clause is included in the Print Set command, the values of these fields are printed for each business object contained within the set. For example, assume you have four objects within a set named Components. You can see the names and descriptions of each object with the following command:

print set Components select name description;

Pagination

Whether a set is sorted or not, it can always be paged through. In MQL, you can print a subset of a set using:

print set SET_NAME [start START_RANGE] [end END_RANGE];
  • START_RANGE is inclusive and zero-based.
  • END_RANGE is exclusive and zero-based.

To scroll through an entire set, you would use commands that resemble:

print set SET_NAME start 0 end 100;
print set SET_NAME start 100 end 200;
print set SET_NAME start 200 end 300;

Methods for performing these operations are also available in the Studio Customization Toolkit (Set.subset, Set.subsetSelect). For more information, see the Studio Customization Toolkit Reference Guide (JavaDocs).

Expressions on Sets

You can evaluate expressions against a set of business objects as described in Formulating Expressions for Collections.