Query practice

advertisement
IBC233 Practice Test 2
Query practice ... Consider the following Physical Files which can be found in the
IBC233LIB course library.
* PRODPF = Product Master physical file
UNIQUE
R PRODPFR
NUMBER
4A
TEXT('PRODUCT
DESC
30A
TEXT('PRODUCT
COLOUR
10A
TEXT('PRODUCT
PRICE
7P 2
TEXT('PRODUCT
K NUMBER
NUMBER')
DESCRIPTION')
COLOUR')
UNIT PRICE')
* INVPF = Inventory Master physical file
UNIQUE
R INVPFR
NUMBER
4A
TEXT('PRODUCT NUMBER')
LOCATION
5A
TEXT('STOCKING LOCATION')
QOH
7P 0
TEXT('QUANTITY ON HAND')
QOO
7P 0
TEXT('QUANTITY ON ORDER')
K NUMBER
RUNQRY *N PRODPF produces the following output:
NUMBER
D101
D102
D104
D103
TA4X
TM5F
E200
E100
E300
D105
DESC
Driver Side Front Door
Passenger Side Front Door
Passenger Side Back Door
Driver Side Back Door
4 speed automatic transmission
5 speed manual transmission
6 cylinder engine
4 cylinder engine
8 cylinder engine
Rear Hatch Door
COLOUR
RED
BLUE
RED
RED
GREEN
PRICE
150.00
150.00
125.00
125.00
1,000.00
900.00
1,050.00
800.00
1,350.00
542.00
RUNQRY *N INVPF produces the following output:
NUMBER
D101
D104
D103
D105
E100
E300
TM5F
LOCATION
A5S34
A2S06
A1S02
A7S15
R4L2
R2L1
R8L1
QOH
2
0
5
1
7
0
2
QOO
0
10
1
13
0
2
1
Given the query output on the following pages, can you recreate those queries?
In the test, you will be asked to describe in detail what you would do to produce such a query.
Your answer does not need to be a keystroke by keystroke account but more like you were telling a user
over the phone exactly what to do (the user at the other end of the phone does not have any of the
documentation you see before you).
You can practice using the files in IBC233LIB.
2016/02/12
Page 1 of 10
IBC233 Practice Test 2
Query 1
Product
Number
D101
D103
D104
D105
E100
E300
TM5F
Description
COLOUR
Driver Side Front Door
Driver Side Back Door
Passenger Side Back Door
Rear Hatch Door
4 cylinder engine
8 cylinder engine
5 speed manual transmission
RED
RED
RED
GREEN
LOCATION
A5S34
A1S02
A2S06
A7S15
R4L2
R2L1
R8L1
Quantity
On Hand
2
5
0
1
7
0
2
Solution
Opt
Query Definition Option
> Specify file selections
Define result fields
> Select and sequence fields
Select records
> Select sort fields
Select collating sequence
> Specify report column formatting
Select report summary functions
Define report breaks
Select output type and output form
Specify processing options
2016/02/12
Page 2 of 10
IBC233 Practice Test 2
Specify File Selections
Type choices, press Enter.
file selection.
Press F9 to specify an additional
File . . .
Library
Member . .
Format . .
File ID .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
PRODPF
IBC233LIB
*FIRST
PRODPFR
P
Name, F4 for list
Name, *LIBL, F4 for list
Name, *FIRST, F4 for list
Name, *FIRST, F4 for list
A-Z99, *ID
File . . .
Library
Member . .
Format . .
File ID .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
INVPF
IBC233LIB
*FIRST
INVPFR
I
Name, F4 for list
Name, *LIBL, F4 for list
Name, *FIRST, F4 for list
Name, *FIRST, F4 for list
A-Z99, *ID
Specify Type of Join
Type choice, press Enter.
Type of join . . . . . . . .
1
1=Matched records
2=Matched records with primary file
3=Unmatched records with primary file
Specify How to Join Files
Type comparisons to show how file selections are related, press Enter.
Tests: EQ, NE, LE, GE, LT, GT
Field
P.NUMBER
2016/02/12
Test
EQ
Field
I.NUMBER
Page 3 of 10
IBC233 Practice Test 2
Select and Sequence Fields
Type sequence number (0-9999) for the names of up to 500 fields to
appear in the report, press Enter.
Seq
10
20
30
40
50
Field
P.NUMBER
P.DESC
P.COLOUR
I.LOCATION
I.QOH
P.PRICE
I.NUMBER
I.QOO
Select Sort Fields
Type sort priority (0-999) and A (Ascending) or D (Descending) for
the names of up to 32 fields, press Enter.
Sort
Prty A/D
10 A
2016/02/12
Field
P.NUMBER
P.DESC
P.COLOUR
I.LOCATION
I.QOH
Page 4 of 10
IBC233 Practice Test 2
Specify Report Column Formatting
Type information, press Enter.
Column headings: *NONE, aligned text lines
Field
P.NUMBER
Column
Spacing
0
Column Heading
Product
Number
Len
4
P.DESC
2
Description
30
P.COLOUR
2
COLOUR
10
I.LOCATION
2
LOCATION
5
I.QOH
2
Quantity
On Hand
7
2016/02/12
Dec
0
Page 5 of 10
Edit
IBC233 Practice Test 2
Query 2
Product
Number
D101
D102
D104
D103
TA4X
TM5F
E200
E100
E300
D105
Description
COLOUR
Driver Side Front Door
Passenger Side Front Door
Passenger Side Back Door
Driver Side Back Door
4 speed automatic transmission
5 speed manual transmission
6 cylinder engine
4 cylinder engine
8 cylinder engine
Rear Hatch Door
RED
BLUE
RED
RED
2016/02/12
GREEN
Quantity
On Order
0
0
10
1
0
1
0
0
2
13
LOCATION
A5S34
A2S06
A1S02
R8L1
R4L2
R2L1
A7S15
Page 6 of 10
IBC233 Practice Test 2
Query 3
COLOUR
Product
Number
D102
BLUE
Description
PRICE
Passenger Side Front Door
150.00
Rear Hatch Door
542.00
Driver Side Front Door
Driver Side Back Door
Passenger Side Back Door
150.00
125.00
125.00
COUNT 1
GREEN
D105
COUNT 1
RED
RED
RED
D101
D103
D104
COUNT 3
FINAL TOTALS
COUNT 5
Query 4
NUMBER
D102
E200
TA4X
Query 5
Product
Number
D103
D101
D105
E100
TM5F
DESC
Passenger Side Front Door
6 cylinder engine
4 speed automatic transmission
Description
Driver Side Back Door
Driver Side Front Door
Rear Hatch Door
4 cylinder engine
5 speed manual transmission
COLOUR
BLUE
Quantity
On Hand
5
2
1
7
2
PRICE
150.00
1,050.00
1,000.00
LOCATION
Unit
Price
125.00
150.00
542.00
800.00
900.00
Extended
Price
$625
$300
$542
$5,600
$1,800
FINAL TOTALS
TOTAL
2016/02/12
QOH
0
0
0
Page 7 of 10
$8,867
QOO
0
0
0
IBC233 Practice Test 2
Your Answer
Specify file selections
Specify report column formatting
Define result fields
Select report summary functions
Select and sequence fields
Define report breaks
Select records
Select output type and output form
Select sort fields
Solution
Details of Query Definition expected on a test. e.g. for Query 5
2016/02/12
Page 8 of 10
IBC233 Practice Test 2
Specify File Selections
Primary: PRODPF, ID: P
Secondary: INVPF, ID: I
Type of join: 1=Matched records where
P.NUMBER
EQ
I.NUMBER
Define Result Fields
EXTPRICE
i.qoh * p.price
Select and Sequence Fields
P.NUMBER, P.DESC, I.QOH, P.PRICE , EXTPRICE
Select Records
I.QOH
NE
0
Select Sort Fields
P.DESC
Specify Report Column Formatting
all Column Headings specified in words and Upper/Lower case
EXTPRICE edited with code J, and Floating currency symbol
2016/02/12
Page 9 of 10
IBC233 Practice Test 2
Select Report Summary Functions
Total of EXTPRICE
Define Report Breaks
[ none for Query 5 but Query 3 has a break on COLOUR ]
Select Output Type and Form
[ Query 5 does not specify type of output. If it said "create a spooled file", then…
Output type: Printer ]
2016/02/12
Page 10 of 10
Download