To sort returned data (an ORDER BY clause)

  1. In the OpenESQL Assistant, click the Sort tab.
  2. In the Columns in SELECT list, click a column you want to sort. This list box displays the column name of every column selected for the query.
  3. Do one of the following:
    • Click Asc to sort the column in ascending order.
    • Click Desc to sort the column in descending order.
  4. If you want to generate the query using a number to represent the column name, check Use integers for column names. The column names are still displayed in the Columns in ORDER BY field, but the integer value of the column is generated for the query.
  5. Insert the sort (ORDER BY clause) into your code by clicking the right-pointing arrow right-pointing arrow.
  • Code you place into the right-hand pane also appears automatically in the generated query.
  • To remove a sort, click the line of code you want to remove in the right-hand pane, then click the left-pointing arrow right-pointing arrow. This places the sort back into the appropriate fields on the left side of the tab, enabling you to edit it. Moving sorts from the right-hand to the left-hand pane also removes the associated COBOL code from the automatically generated query.