Creating/Editing/Running BiQ iBasic Queries · 2019. 6. 24. · • 2 Julian date: YYYYxxx xxx =...
Transcript of Creating/Editing/Running BiQ iBasic Queries · 2019. 6. 24. · • 2 Julian date: YYYYxxx xxx =...
Creating/Editing/Running B i Q iBasic Queries
Mi h ll H kiMichelle Haskin
Query
Joining Files Dates Result fields Select & Sequence fields Select records
S l t t fi ld Select sort fields Specify report column formatting
Select report s mmar f nctions Select report summary functions Define report breaks Select output type & form Select output type & form
Navigation-Cardinal.com
Highlight the menu item you wish to edit/view d li k th S l t b ttand click on the Select button.
F5 will display data while working with the query. F10 will go back one screen and will save the
information on the current screen.F12 ill b k d ill i F12 will go back one screen and will ignore any changes made to the current screen.F13 (Shift F1) ill displa la o t of data F13 (Shift F1) will display layout of data.
Navigation Green Screen
Key 1 beside the menu item you wish to edit/view.
F5 will display data while working with the query. F10 will go back one screen and will save the
information on the current screen. F12 will go back one screen and will ignore any
changes made to the current screen. F13 (Shift F1) will display layout of data.
Joining Files
There are 3 ways to join fields. 1=Matched records--All files must have a
matching record; if not, the record will not be selected For example: if you are joining DDMAST &
DDHOLD you will get only accounts that have holds placed on them.
Joining Files
2=Matched records with primary file--All records in the primary file will be selected and all recordsin the primary file will be selected and all records in subsequent files that have a match will be joined.joined.
For example: if you are joining DDMAST & DDHOLD, you will get all records in DDMAST , y gand any record that has a hold will have that information joined. In this case if you have multiple holds on an account you would have the account on report multiple times.
Joining Files
3=Unmatched records--Only records in the yprimary file that do not have a match in all subsequent files will be displayed.q p yFor example: Joining DDMAST and DDHOLD with option 3 would select onlyDDHOLD with option 3 would select only accounts that do not have a hold.
Joining Files
You must define the account fields that are used to join a file. You must select at least two fields, one from each file. Fields must be the same in both files, i.e.
numbers must be joined with numbers and l h j i d ith l halpha joined with alpha.
Field names must be proceeded with 1 – 3 character identifier s ch as T01 A etccharacter identifier, such as T01, A, etc.
Joining Files
You can use more than one test to join two files, such as account number and account type.
You can specify up to 100 join tests. When one or both fields are null, the records are
not joined in a matched record join. You can specify *ALL to join all fields, this will
result in all records in the first file being joined ith all records in the second file This is sef lwith all records in the second file. This is useful
when adding the processing date to a file.
Joining Files .com
Joining Files .com
Joining Files .com
Joining Files
Joining Files
Joining Files
Joining Files .com
To join DDMEND with DDPAR0 using the j g*ALL function:
Joining Files .com
Joining Files .com
Joining Files
To join DDMEND with DDPAR0 using the j g*ALL function:
Joining Files
Joining Files
Joining Files
Sequencing Secondary Files for a Primary Join.• Using type 2 or 3 means there is one primary
fil d ll th dfile and all others are secondary. • Order of files can be important if joining more
than 2 filesthan 2 files.• Use join tests to connect each secondary file
to a file listed above it. You may join file A to y jfile B, then join file A to file C or you may join file A to file B then join file B to file C.
Joining Files
Sometimes the order of the files and the join field can cause duplicate entries.
Sometimes you can correct this by joining multiple fields for two files. Such as DDMAST and DDMEND. E l if h DDA d SAV ith Example if you have a DDA and a SAV with same account number. If you join only account number you will get two records for each type ofnumber, you will get two records for each type of account for each month end record.
Dates
Cardinal stores 2 dates:• 1 MMDDYY• 2 Julian date: YYYYxxx
xxx = the actual day of the year, for example:January 31, would be 2009031June 30 would be 2009182 (June 30 is the 182nd dayJune 30, would be 2009182 (June 30 is the 182nd day of the year.
Dates
When selecting a date range it is best to g guse Julian date. Invest in a date calculator. You can use Cardinal’s date calculator to
get the Julian date.get the Julian date. You can use Results Fields to calculate
time frames for selecting datatime frames for selecting data.
Select and Sequence Fields .com
This is the screen that you select the fields you want to appear on your report and you select the sequence you want them printedreport and you select the sequence you want them printed
Select and Sequence Fields This is the screen that you select the fields you want to appear on your
report and you select the sequence you want them printed.p y q y p
Selecting Records
You can select records by comparing to another field or to a value/constant.
Operandi are as follows:• EQ EqualEQ Equal• NE Not Equal• GT Greater than• GE Greater than or Equal to• GE Greater than or Equal to• LT Less than• LE Less than or Equal to• RANGE The field being tested falls on or between these values• RANGE The field being tested falls on or between these values• LIST The field being tested is one of the listed values.• NLIST The field being tested in not one of the listed values.
Selecting Records
You can select records based on any field yin the files whether or not they are displayed on your query/report. p y y q y p You can use multiple criteria to select
records by using the AND function.records by using the AND function. Anytime you use the OR function it starts
the selection criteria overthe selection criteria over.
Selecting Records .com
Selecting Records .com
Example of ANDp
Selecting Records .com
Example of ORp
Selecting Records
Selecting Records
Example of ANDp
Selecting Records
Example of ORp
Sort Fields
Select the sort order for your data, such as ybranch, then product then current balance. You can select to sort in Ascending orYou can select to sort in Ascending or
Descending order.
Sort Fields .com
Sort Fields
Report Column Formatting
Allows you to manage the presentation of your report:• Fields can be lengthened or shortened.• The heading descriptions can be changed to
something more meaningful to you or to something that is shorter than the standardsomething that is shorter than the standard heading.
• Column spacing can be changed as well to p g gshorten the width or give you more space between fields.
Report Column Formatting com.com
Report Column Formatting
Report Summary Functions
Allows you to determine the following y gelements of a field in your query:• Total• Average• MinimumMinimum• Maximum• Item CountItem Count
Report Summary Functions com.com
Report Summary Functions
Report Breaks
You can insert breaks and subtotals for certain groups of items, such as branch, officer, product, account type, etc.
You can assign a break level to either perform a page break and total at the end of a group of items or just total a group of items and continueitems or just total a group of items and continue the next group on the same page.
The sort priority is designated in the sort field The sort priority is designated in the sort field above. You must first select sort order then break order based on sort order.
Report Breaks .com
Report Breaks
Report Breaks
You can choose to suppress the summary totals on the final page. This is useful when sorting transactions by debit/credit
d t t l f ll it i t h l f l Yand a total of all items is not helpful. You would still total the debits and total the credits but suppress the total of all debitscredits, but suppress the total of all debits and credits (combined). You can define the wording on the final You can define the wording on the final
totals for the report.
Report Breaks .com
Report Breaks
Report Breaks
You can choose to insert a page break.p g You can choose to Suppress summaries
of a group.of a group. You can add the code to the report break,
which makes the report easier to readwhich makes the report easier to read, especially when you are only pulling totals or you have a very long list of itemsor you have a very long list of items.
Report Breaks .com
Report Breaks
Select Output Type & Output Form
Select file, report or display output.p p y p Select a specific printer or *PRINT. Select forms type Select forms type. Select number of copies. Select line spacing and wrapping. Select cover page and text for cover page.g g Select standard headings.
Select Output Type & Output Form
Select Display, Print or Database File, if p yyou select file you will get an additional screen to define the file name and library.y Select Detail or Summary. Select line wrapping and width Line Select line wrapping and width. Line
wrapping is used if your report is more than 132 characters and you need two orthan 132 characters and you need two or more lines for each record in the query.
Select Output Type & Output Form comForm .com
Select Output Type & Output Form
Select Output Type & Output Form
Select a specific printer to print to OR leave as *PRINT. When you use *PRINT, the report will print to the printer designated for the print jobs of that user (i e where snapshot statements wouldthat user (i.e. where snapshot statements would print).
If setting this report up in Information If setting this report up in Information Distribution, you should leave it as *PRINT. The Distribution Point that you add the report to willDistribution Point that you add the report to will determine where the report prints.
Select Output Type & Output Form comForm .com
Select Output Type & Output Form
Select Output Type & Output Form
Select to spool the output. Select the forms type. For most of your
reports you will choose *STD. Choose the number of copies to print. Choose to hold the report. This is useful p
if you want to view the report on the printer before you actually print it. Once you are ready to print, you can release the spool file.
Select Output Type & Output Form comForm .com
Select Output Type & Output Form
Select Output Type & Output Form
You can print a cover page. This is useful p p gto direct the query to a particular person or for instructions or an explanation of the preport.
Select Output Type & Output Form comForm .com
Select Output Type & Output Form
Select Output Type & Output Form
You can add a title that will print on each ppage of the report. You can also add the date, time &/or pageYou can also add the date, time &/or page
by using the following commands &DATE &TIME &PAGE. This is helpful to know&TIME &PAGE. This is helpful to know what date and time a report ran.
Select Output Type & Output Form comForm .com
Select Output Type & Output Form
Select Output Type & Output Form
Select file name.S l t lib f fil Select library for file.
Choose new file, replace or add to file. Typically you will choose to replace the file, unless youyou will choose to replace the file, unless you want to add to file.
Choose file authority. Normally you choose the default but if you need to give someone elsedefault, but if you need to give someone else access to the file you would choose the appropriate level of authority. This is explained in more detail in the ad anced q er trainingin more detail in the advanced query training.
Choose description for file.
Select Output Type & Output Form .comForm .com
Select Database file
Select Output Type & Output Form .comForm .com
Select Output Type & Output Form
Select Output Type & Output Form
Query!!
Questions???????
Query!!
Resources:• Internet-search iSeries Query• Cardinal• Other users
Information Distribution
To setup a query in Information p q yDistribution to run on a regular basis:• Go to the Information Distribution System.y• Select the option for Reports Definitions. Key the query name, key a description, key a y q y y p y
report alternative title (if desired), forms type (normally *STD), application (normally MS), Print file name is same as query name set Queryfile name is same as query name, set Query Report to Y (yes).
Information Distribution .com
Information Distribution
Information Distribution
Take the option for Distribution Points. Select distribution point (can be optical or
someone’s distribution point). Select report name, (to get to report list,
press F6 or click select reports). Use the position to, locate the report and
flag for daily or a particular schedule. This works just like selecting any report for
distribution.