• Aucun résultat trouvé

OUTPUT INDICATORS

Dans le document RPG II (Page 87-90)

1 2

Figure 10-2. Specifications of Fetch Overflow Feature

SPACE FORMS CONTROL

after line is printed.

No spacing the destination of a space operation is· a line in the overflow area, the overflow indicator, if assigned, turns on and space before printing at the console device.

SKIP FORMS CONTROL

Columns Values Meanings

19-20 01-99 Lines 1-99

~eading zero must be supplied for lines 1 through 9.

The codes designate the forms location of the next line to be printed. When the skip is to a lower line number, the forms are advanced. No action occurs when the forms are already positioned at the specified line.

If the destination of a skip is beyond the overflow line but before top of form, an overflow indicator assigned to the file is set on and remains on until forms advance occurs.

The destination line of a skip operation must not be beyond the form length defined on the Line Counter sheet.

The skip feature is useful in moving form stock more than

Output indicator entries are used to condition output of entire records and/or fields of records. Any of the indicators associated with RPG

n

may be specified.

Numerical indicators (01 through 99), control level indi-cators (LI through L9), halt indiindi-cators (HI through H9), and external indicators (U1 through U8) require previous specifi-cation in the RPG

n

program. When an overflow indicator (OA through OG or OV) is used to condition a record and/or field, that indicator must have been previously assigned to the same file in the file description specifications.

An indicator that conditions a re("ord is entered on the pertinent record description line; similarly, an indicator that' conditions a field is entered on the pertinent field beginning of the program cycle, when IP lines are written.

Overflow indicators may not be used to condition exception records (E in column 15). Overflow indicators may condition fields of exception records, however.

Records conditioned by overflow indicators are produced only when overflow has been sensed for the file. An overflow indicator may have an OR relationship with ,the IP indicator if identical heading records go on every page of the file. The lP indicator, however, may be specified only

fo~ heading and detail records.

When a control level indicator (Ll through L9) conditions a total record without an overflow indicator, the record is written only after the last record in the control group has been processed. A detail record conditioned by a control level indicator but not an overflow indicator is produced only after the first record of the new control group has been processed. When columns 23 through 31 contain both a control level indicator and an overflow indicator, the record is produced only when overflow has been sensed and the control break has occurred.

All records conditioned by the last record indicator (LR) are produced last.

NOTE

Only one record is written to an update or combined file per cycle. Unpredictable results may occur if multiple records are usually listed sequentially. however, for easy reference. If later fields overlap the first fields. overlapped data from the first fields is lost. Entries in these columns are

According to the internal representation of numeric data. a negative number shows a letter as the rightmost digit unless the field is edited (see Edit Codes).

PAGE, PAGEl, PAGE2

RPG II automatically numbers print file pages if PAGE.

PAGEl, or PAGE2 is entered in columns 32 through 37. The three page counters, PAGE, PAGEl, and PAGE2, are provided for use with three different output files. The same name should not be used with two different output files.

. When a page counter is named in these columns without being defined elsewhere in the program. the page number is taken from a four-digit numeric counter with no decimal positions; RPG II increments the counter by one before using it on each page.

On the other hand, a page field may be defined in the input or calculation specifications and be up to 15 positions long.

Zero decimal positions are still required for a otherwise specified, and RPG II automatically increments a page counter by one every time the counter is output; this is true for page counters that are defined internally and page counters that are defined in the program.

A page counter may be reset to zero during program execution in several ways. One way is to specify Blank

After (column 39) in the same line in which the page counter is referenced. Another way is to use an output indicator to condition the' page counter field. An output indicator does not truly condition output of the page counter, as a counter is output any time its associated record is output. When the output indicator is on, however, the specified page counter is reset to zero and incremented by one before the record is printed. Other ways to change the value of a page counter during program execution are to use the Z-ADD and MOVE operation codes in the caiculation specifications with the desired reset value entered as a numeric literal in Factor 2 and the appropriate page counter in the Result Field.

*PLACE

*PLACE is a special RPG II word allowing fields to occupy more than one position in an output record without being respecified. When RPG II encounters *PLACE, all fields previously specified for the record are repeated in the same relative positions, ending at the character position named in columns 40 through 43 of the *PLACE line. A set of fields may be produced in a _ single record more than twice by the use of multiple *PLACE lines. An example of using the

*PLACE feature is shown in figure 10-3. Either method of

CO~OLDATA

CORrO~nON RPG OUTPUT

coding produces the output record shown in figure 10-4.

When several fields are being repeated, the *PLACE feature is a very convenient device for saving lines of coding.

These rules should be followed when using *PLACE:

o *PLACE is entered on the line immediately following the last field specification to be repeated.

o *PLACE entries may be made on successive lines o An *PLACE specification causes all prior field

specifi-cations for the record to be repeated.

o The end position specified for *PLACE should be at least twice the previously named end position for the record (not including previous *PLACE specifications), but not greater than 256. If this is not done, over-lapping of fields results, with the *PLACE fields overlapping prior characters. The specified end position must not be lower than the preceding end position specification.

• The starting (leftmost) character position for an

*PLACE move is always position one of the record.

SPECIFICATIONS

Punchi,.

1 .. lnICtion

I ::~ I I I III I I

Card EIIcVo Number

I:: ... , I

Dote

0 ~~

~ Skip Output Indicators

~?~i::ti ~;,:/0'" ..

~:!

[;:;~I~"

:f

l£l Comma Zero Balances NoSi", eR

-

X· R _ I

I'>'

~ .... to Print Plus Sign

't.'

'1

Ii AL 1

•.. ~. "'~,J}."-. Yes Yes 1

A

J y . Dill I;:.

II

YIS No 2 B K Field Edit

...

Line Filename

II :

. ' : ; End No Yes 3 C L Z • Zero

F!

::( ~ Positon No No 4 0 M Supprea ' ;

! ~D

I ~ -

in IE

~ E ~ :: I; i . i I Output :l Constant or Edit Word

~~

~ "

~ ~;ro « ·AUTO Roterd

3 4 5 6 7 8 9 10 11 12 13 14 t5 16 n 18 II 20 21 22 :13 24 25 215 27 28 2830 31 ~ 33 34 a 38 37

38.

40 41 42 43 44 45 40 47 48 49 50 51 52 53 54 55 5& 57 58 59 60 61 62 63 64 65 66 67 68 69 70 7t 'It

n,.

o 1 ~o

o 2 ~°lt ~1 " F1 'I "': ~'

t 'LA

~~ ~~7t ~Lth.. --o 3 ,...,0

o 4 QO pI~ .'IlftJT I .1 cll

o 5 QO -- f-- IFIL .IlIA

It!

o 6 0 0 I~IL

:))18

l11~

~-o 7 ,...0 ~ILll

~~r-o 8 ",0 . 11= I L Jj 121~ --- -r-:-:. -

--o 9 ~O - i - - - - I -

IrL

IZ:'A 1.=

Ie

IlB

31~

1 0 ~o ---1----~ .. -

I':L

--f---- . - -- f - - .----,-

~--11 to ..

1 2 Ie 0

bo~ ... t{.

..tJ

~ ~C~ ~~ . -I-

-I 3 I 4 Ir-o )L D, l "'~ _. --I

-ipl~ lAh' tJ: 1

---

1-1-1 5 ~O t"1.i

1 6 DO

II

i llll

Il

1 7 ~O

Ft

1)i3

lt2

i 8 ~O ~if

ILA

Clf ~I'I

1 9 bo oil' l.!I'" , :Q '~II: .... 1 . .

6'

2 0 0

-Figure 10-3. Example of Coding with the *PLACE Feature

RECORD

POSITION

It .1

.121 181 241 301 361

t.FLDA FLOO"" FLDA

-+-

FLOO +FLDA ... FLOO-.(

0307

Figure 10':'4. Exam~le of *PLACE Output DATE FIELD

The special words UDATE, ,UMONTH, UDAY, and UYEAR-refer to the runtime-supplied current date. A UYEAR-reference to UDATE yields a six-character numeric date field in one of the formats:

• Domestic: mmddyy

.• Foreign (including United Kingdom): ddmmyy

The format desired is specified in column 21 of form H, Control Card Specifi,cations. When a UDATE field is edited, the eight-character. result is one of the following:

• Domestic: mm/dd/yy

,

• United Kingdom:'. dd/mm/yy

• Foreign: dd.mm.yy

UMONTH refers to the two-character mm, UDAY to dd, and UYEAR to yy.

None of these special words may be specified in the result field of a calculation operation. Any of the words, however, may be used as Factor 1 or Factor 2 of a calculation operation.

Dans le document RPG II (Page 87-90)

Documents relatifs