Monday, November 29, 2010

jBase Query Language LIST

Generates a formatted report of records and fields from a specified file

Command Syntax

LIST file-specifier {record-list} {selection-criteria} {sort-criteria} {USING file-specifier} {output-specification} {format-specification} {(options}
Comments : If providing no output specification clause the system searches for default data definition records (named 1, 2 and so on) in the file dictionary and then in the file specified in the JEDIFILENAME_MD environment variable. If no default data definition records are found, it lists only the record keys. You must specify a sort criteria clause to sort the records.

Example 1

LIST SALES
List all the records in the SALES file and use the default data definition records (if found) to format the output.

Example 2

LIST ORDER "ABC" "DEF" "GHI"
List the records from the ORDER file with key values of ABC, DEF or GHI. Use the default data definition records (if found) to format the output.

Example 3

GET-LIST ORDER
>LIST ORDER GT "DEF"
Get the previously saved list called ORDER.Q4 and, using the list, report on the records in the ORDER file which have a key greater than DEF. Use the default data definition records (if found) to format the output.

Example 4

LIST ORDER WITH ORD.ID = "ABC]" OR "[DEF"
List the records in the ORDER file in which the ORD.ID field contains values which start with ABC or end with DEF. Use the default data definition records (if found) to format the output.

Example 5

LIST ORDER WITH NO ORD.ID = "ABC]" OR "[DEF" (P
List the records in the ORDER file in which the ORD.ID field does not contain values which start with ABC or end with DEF. Output the report to the printer. Use the default data definition records (if found) to format the output.

Example 6

LIST order BY ORD.AMT BREAK-ON ORD.AMT "BL" ORD.ID ORD.COST GRAND-TOTAL "Total" HEADING "Sales Code: "B" "DL" FOOTING "Page "CPP" LPTR
Sort the ORDER file by ORD.AMT. Output the ORD.AMT, ORD.ID and ORD.COST fields.
Control break on a change in ORD.AMT and suppress the LINE FEED before the break. Reserve the break value for use in the heading ("B").
Maintain a running total of the ORD.COST field and output it at each control break.
Put the word "Total" on the grand-total line.
Set up a heading for each page which comprises the words "Sales Code: ", the sales code (from the break), a date and a LINE FEED. Set up a footing, which contains the text "Page", and a page number, centered on the line.
Produce the report on the currently assigned printer.

0 comments:

Post a Comment

 

Blog Info

A Pakistani Website by Originative Systems

Total Pageviews

Tutorial Jinni Copyright © 2015 WoodMag is Modified by Originative Systems