*KEY 5 50
01 *RECORD
~'cCODE
C H 1
CODE 1 1
CUSTNO 5.0 6
ORDNO 6 12
CUSORD 5 17
DATE
825
SHPTO 2 27
SHPVIA 15 42
02
~'cRECORD*CODE C D 1
CODE 1 1
CUSTNO 5.0 6
ORDNO 6 12
QTY 4.0 16
PARTNO 6 22
Figure 11. DFU Attributes Created for Example 1
As you read the following prompts, you may find it helpful to follow the explanation of the prompting sequence for creating and maintaining a data file in Figure 6 of this chapter. This provides a complete explanation of each'l?rompt,
the responses allowed, and the results of keying a response. "
*FILE SALESORD 50
*KEY 5 50
01 *RECORD
*CODE C H 1
ENTER VALUES FOR 'DELETE CODE,POSITION'
*FILE SALESORD 50
*KEY 5 50
01 *RECORD
*CODE C H 1
SHOULD DFU GENERATE RECORD KEYS FOR YOU?
If you have scanned the DFU attributes, return them as shown in this display screen to their original position.
Key X,1 on line 6 and press ENTER to indicate a delete code of X in position 1 of the record.
Respond with the YES command key. (This prompt occurs because the record key field is defined as five positions long in the RPG II source member.)
DFU Setup Step 43
*FILE SALESORD 50
*KEY 5 50
0:1 *RECORD
*CODE C H :1
ENTER COLUMN HEADING FOR KEYS
*FILE SALESORD 50
*KEY 5 50
0:1 *RECORD
*CODE C H :1
ENTER COL SPACING VALUE (0-9,DEFAULT=:1l
*FILE
*KEY 0:1 *RECORD
*CODE ENTER TITLE
0:1 *RECORD
SALESORD
C H
50
5 50
:1
*CODE C H :1
CODE :1 :1
CUSTNO 5.0 6
0:1-- ANY FIELDS FROM THIS RECORD TYPE?
0:1 *RECORD
*CODE C H
CODE CUSTNO ENTER FIELD NAME
:1 5.0
:1 :1 6
Press the ENTER key to indicate that the default head-ing, *KEY, should be used.
Key 2 and- press ENTER to indicate that you want two spaces to separate field columns on the display screen and pri nted output.
Key DAILY SALES ORDERS, your title for the job, then press the ENTER key to continue with the prompts.
Respond with the YES command key. (The first record type specified in the RPG II source member is 01. The first four lines of the display show the DFU attributes for this record type.)
Prompting now begins to allow you to key information for the fields to be entered from the header record. Key ORDNO, the name of the first field the operator will enter, and press the ENTER key.
Note that the order in which you name the fields does not have to be the same as the order of the fields in the DFU attributes. You should key the field names as they appear on the order form-not necessarily in the same order as in the DFU attributes.
01 *RECORD
*CODE C H
CODE CUSTNO ENTER COLUMN HEADING
oj, *RECORD
1
5.0 1 1 6
*CODE C H 1
CODE 1 1
CUSTNO 5.0 6
IS THIS AN AUTO-DUP FIELD?
01 *RECORD
*CnDE C H
CODE CUSTNO ACCUMULATE THIS FIELD?
01 *RECORD
*CODE C H
CODE CUSTNO ENTER FIELD NAME
01 *RECORD
*CODE C H
CODE CUSTNO ENTER COLUMN HEADING
1
5.0
1
5.0
1
5.0
1 1 6
1 1 6
1 1 6
Key OUR OROER NO., the heading for the ORONO field, and press the ENTER key. Assign headings so they correspond to the headings used on the order forms.
Then, the headings on the order form will match the headings that appear on the display screen when the file is being created. This results in less confusion and less chance for a keying mistake when creating the file.
Respond with the YES command key to define ORONO as an auto dup field.
Press the REC AOV key to indicate that ORONO is not an accumulator field and you want to skip the prompts for the self check feature.
Key DATE, the next field, and press the ENTER key to continue with the prompts.
Since the heading is also DATE, press REC ADV with-out keying a response. This causes (1) the field name, DATE, to be used as the heading, and (2) the
ENTER FIELD NAME
prompt to appear, skipping the prompts for the auto-dup, accumulator, and self check features.
DFU Setup Step 45
01 *RECORD ENTER COLUMN HEADING
ENTER FIELD NAME
Press the ENTE R key to continue with the prompts.
Key the heading, CUSTOMER NO., then press the ENTER key to continue with the prompts.
01 *RECORD
*CODE C H 1
CODE 1 1
CUSTNO 5.0 6
IS THIS AN AUTO-DUP FIE~D?
01 *RECORD
*CODE C H
CODE CUSTNO ACCUMULATE THIS FIELD?
01 *RECORD
*CODE C H
CODE CUSTNO ENTER FIELD NAME
'ENTER FIELD NAME SHPTO
ORDNO CUSORD DATE SHPTO
ORDNO CUSORD DATE SHPTO ENTER COLUMN- HEADING
1 5.0
6 5 8 2
6 5 8 2
1 5.0
1 1 6
12 17 25 27
12 17 25 27
1 1 6
Respond with the YES command key because CUSTNO is an auto dup field.
Press the REC ADV key because CUSTNO is not an accumulator field.
Press the ROLL t key four times to bring SHPTO, the next field to describe, to line 4 of the display. Press the DUP key.
SHPTO appears on line 6. Press the ENTER key to continue with the prompts.
Key the heading, SHIP TO, and press REC ADV to return to the
ENTER FIELD NAME prompt.
DFU Setup Step 47
ENTER FIELD NAME ENTER COLUMN HEADING
ENTER FIELD NAME
Press'the ROLLt key once to bring SHPVIA, the next field to describe, to line 4 of the display. Then press
Respond,with the YES command key. You will describe the ORONO, CUSTNO, OTY, and PARTNO fields in record type 02. You will define ORONO and CUSTNO as auto dup fields and OTY as an accumulator field.
02 *RECORD
*CODE C D
CODE CUSTNO ENTER FIELD NAME
*CODE C D
CODE CUSTNO ORDNO ENTER COLUMN HEADING
1.
5.0
1.
5.0 6
1.
1.
6
1.
1.
6 1.2
*CODE C D 1.
CODE 1. 1.
CUSTNO 5.0 6
ORDNO 6 1.2
IS THIS AN AUTO-DUP FIELD?
*CODE C D
CODE CUSTNO ORDNO ACCUMULATE THIS FIELD?
*CODE C D
ENTER FIELD NAME CODE CUSTNO ORDNO
1. 5.0 6
1.
5.0 6
1.
1.
6 1.2
1.
1.
6 1.2
Press the ROLL t key once, then press the DUP key instead of keying ORONO. Press the ENTER key to continue.
Key the heading, OUR ORDER NO., then press the ENTE Rkey to continue with the prompts.
Respond with the YES command key.
Press the REC ADV key.
Press the ROLL-!- key once, then press the DUP key instead of keying CUSTNO. Press the ENTER key to continue.
DFU Setup Step 49
02 *RECORD
*CODE C D
CODE CUSTNO ENTER COLUMN HEADING
02 *RECORD
:L 5.0
:L :L
6
*CODE C D :L
CODE :L i
CUSTNO 5.0 6
IS THIS AN AUTO-DUP FIELD?
02 *RECORD
*CODE C D
CODE CUSTNO ACCUMULATE THIS FIeLD?
02 *RECORD
*CODE C D
CODE CUSTNO ENTER FIELD NAME
CODE CUSTNO ORDNO QTY ENTER COLUMN HEADING
:L 5.0
:L 5.0
:L 5.0
.~
4.0 :L :L
6
:L
:L 6
:L
6
:L2 :L6
Key the heading, CUSTOMER NO., then press the ENTER key to continue with the prompts.
Respond with the YES command key.
Press the REC ADV key.
Press the ROLL t key twice, then press the DUP key instead of keying QTY. Press the ENTER key to continue.
Key the heading QUANTITY, then press the ENTER key.
CODE 1 1 ENTER COLUMN HEADING
ENTER FIELD NAME
**** DFU ATTRIBUTES ****
DFU determines that there are no more record types defined in the RPG II source member and shows the first
01
four DFU specifications on lines 1 through 4 of the display
02
screen. As explained in lines 5 and 6 of the display, youcan modify the specifications at this time (refer to Chapter 10, DFU Specifications, for an explanation of how to do this) or you can end the setup step. In this example, you do not need to modify the specifications. Press the PRINT
REC command key to list the DFU attributes and specifica-tions. Then press the EOJ command key to build the for-mat description. Figure 12 shows the DFU attributes and specifications built in this setup step.
An
ENTER NUMBER OF RECORDS TO BE IN FI LE prompt appears. key 50 and press ENTER, since you
****
anticipate a maximum of 50 header and detail records to 2
be in this file.
01
This ends the setup step for this job. You have created the format description, ORDERFMT, that allows the operator to create and maintain the customer order file. The job run automatically begins. For this example, the operator is
required to create the SALESORD file and key three order
02
forms into it; the example in Chapter 4 shows how this isdone. The operator is also required to maintain the file by adding, deleting, and changing information in it; the example in Chapter 5 shows how this is done.
Figure 12. DFU Attributes and DFU Specifications Created for Example 1.