Download presentation
Presentation is loading. Please wait.
Published byJennifer Harper Modified over 9 years ago
1
lecture 61 Editted Output Editing Functions –Two broad classes : A) insertion and B) replacement and suppression 1.Printing decimal points 2.Suppressing leading zeros 3.Printing dollar signs and commas 4.Insertion characters 5.Printing asterisks for check protection 6.Signed Numbers 1, 2, 3, 5, and 6 are only for numeric fields 4 is for any data field
2
lecture 62 Report Item An item whose PIC clause performs an editing function Can appear in the GIVING option, MOVE, and COMPUTE statements Make your report look nicer!
3
lecture 63 STUDENT NAMECREDITSTUITION UNION FEE ACT FEESCHOLARSHIP TOTAL BILL SMITH JB 15003000 025 075 00000003100 JAMES HR 15003000 000 075 00000003075 BAKER SR 09001800 000 050 00500001350 PART-TIMER JR 03000600 025 025 00000000650 JONES PL 15003000 025 075 00000003100 HEAVYWORKER HM 18003600 000 075 00000003675 LEE BL 18003600 000 075 00000003675 CLARK JC 06001200 000 025 00000001225 GROSSMAN SE 07000600 000 025 00000001450 FRANKEL LF 10002000 000 050 00000002050 BENWAY CT 03000600 000 025 00250000375 KERBEL NB 04000800 000 025 00000000825 -------- ------- ------- -------- --------- 024500 0075 0625 000750024550 (a) Without Editing STUDENT NAMECREDITSTUITION UNION FEE ACT FEESCHOLARSHIP TOTAL BILL SMITH JB 15 $3,000 $25 $75 $3,100 JAMES HR 15 $3,000 $75 $3,075 BAKER SR 9 $1,800 $50 $500$1,350 PART-TIMER JR 3 600 $25 $25 $650 JONES PL 15 $3,000 $25 $75 $3,100 HEAVYWORKER HM 18 $3,600 $75 $3,675 LEE BL 18 $3,600 $75 $3,675 CLARK JC 6 $1,200 $25 $1,225 GROSSMAN SE 7 600 $25 $1,450 FRANKEL LF 10 $2,000 $50 $2,050 BENWAY CT 3 600 $25 $250 $375 KERBEL NB 4 800 $25 $825 LUCKY ONE FR 9 $1,800 $50 $2,000 $150CR -------- ------- ------- -------- --------- $26,400 $75 $675 $2,750$24,400 (b) With Editing
4
lecture 64 Printing Decimal Points : ‘.’ V does not use a position in storage –PIC 99V9 for 12.3 stored as 123 Decimal point does occupy a storage position
5
lecture 65 Decimal Points Sending Receiving Sending Receiving Picture Data Picture Result Picture Data Picture Result PIC 999V9912345PIC 999.99 PIC 999V9902345PIC 999.9 PIC 999V9951234PIC 99.99 PIC 999456PIC 999.99 Sending Receiving Sending Receiving Picture Data Picture Result Picture Data Picture Result PIC 999V9912345PIC 999.99 PIC 999V9902345PIC 999.9 PIC 999V9951234PIC 99.99 PIC 999456PIC 999.99 123.45 023.4 12.34 456.00
6
lecture 66 Suppressing Leading Zeros : ‘Z’ ‘Z’ in a PIC replaces leading zeros with blanks –Thus, represents one storage position Representing the number zero (b is a blank) PIC ZZZ9 bbb0 PIC ZZZZ bbbb
7
lecture 67 Dollar Signs and Commas : ‘$’, ‘,’ You can place ‘$’ and ‘,’ anywhere in a PIC They take up a storage position ‘Z’ will suppress both zeros and commas until the first significant digit Value 1234.98, $9,999,999.99 $0,001.234.98 $Z,ZZZ,ZZ9.99 $bbbb1,234.98
8
lecture 68 Suppressing Leading Zeros Sending Receiving Sending Receiving Picture Data Picture Result Picture Data Picture Result PIC 9(5)12345PIC ZZ,999 PIC 9(5)01234PIC ZZ,999 PIC 9(5)00123PIC ZZ,999 PIC 9(5)00012PIC ZZ,999 Sending Receiving Sending Receiving Picture Data Picture Result Picture Data Picture Result PIC 9(5)12345PIC ZZ,999 PIC 9(5)01234PIC ZZ,999 PIC 9(5)00123PIC ZZ,999 PIC 9(5)00012PIC ZZ,999 12,345 1,234 123 012
9
lecture 69 Fixed Insertion Characters : “B”, “0”, “/”, “,” Used as separators within fields Hold a position in storage Act as zero and comma suppression, just as “Z” does, except uses *’s instead of blanks Check Protection : “*”
10
lecture 610 Sending Receiving Sending Receiving Picture Data Picture Result Picture Data Picture Result PIC 999999123456PIC 999,999 PIC 9(6)000078PIC 9(3),9(3) PIC 9(6)000078PIC ZZZ,ZZZ PIC 9(6)000178PIC ***,*** PIC 9(6)002178PIC ***,*** PIC 9(6)120183PIC 99B99B99 PIC 9(6)120183PIC 99/99/99 PIC 9(6) 001245PIC 990099 Sending Receiving Sending Receiving Picture Data Picture Result Picture Data Picture Result PIC 999999123456PIC 999,999 PIC 9(6)000078PIC 9(3),9(3) PIC 9(6)000078PIC ZZZ,ZZZ PIC 9(6)000178PIC ***,*** PIC 9(6)002178PIC ***,*** PIC 9(6)120183PIC 99B99B99 PIC 9(6)120183PIC 99/99/99 PIC 9(6) 001245PIC 990099 123,456 000,078 78 ****178 **2,178 120183 12/01/83 120045
11
lecture 611 Signed Numbers : “+”, “-” Can appear to the left or right of the number “+” –Always generates a sign, whether pos. or neg. “-” –If the number is pos., the sign is omitted
12
lecture 612 Sending Receiving Sending Receiving Picture Data Picture Result Picture Data Picture Result PIC S999 -123PIC -999 PIC S999 -123PIC 999- PIC S999+123PIC -999 PIC S9(5)+12345PIC +9(5) PIC S9(3)-123PIC +9(3) PIC S9(3)-123PIC 999+ Sending Receiving Sending Receiving Picture Data Picture Result Picture Data Picture Result PIC S999 -123PIC -999 PIC S999 -123PIC 999- PIC S999+123PIC -999 PIC S9(5)+12345PIC +9(5) PIC S9(3)-123PIC +9(3) PIC S9(3)-123PIC 999+ -123 123- 123 +12345 -123 123-
13
lecture 613 Floating Strings : “$”, “+”, “-” Suppression of zeros into blanks Causes the floating character to appear adjacent to the first significant digit Can use only on the left side
14
lecture 614 Sending Receiving Sending Receiving Picture Data Picture Result Picture Data Picture Result PIC 9(4) 0000PIC $$,$$9.99 PIC 9(4) 0080PIC $$,$$9.00 PIC 9(4) 0128PIC $$,$$9.99 PIC 9(5) 57397PIC $$,$$9 PIC S9(4)- 0005PIC ++++9 PIC S9(4)+0080PIC ++++9 PIC S9(4)- 0080PIC - - - - 9 PIC S9(5)+71234PIC - - - - 9 Sending Receiving Sending Receiving Picture Data Picture Result Picture Data Picture Result PIC 9(4) 0000PIC $$,$$9.99 PIC 9(4) 0080PIC $$,$$9.00 PIC 9(4) 0128PIC $$,$$9.99 PIC 9(5) 57397PIC $$,$$9 PIC S9(4)- 0005PIC ++++9 PIC S9(4)+0080PIC ++++9 PIC S9(4)- 0080PIC - - - - 9 PIC S9(5)+71234PIC - - - - 9 $0.00 $80.00 $128.00 $7,397 -5 +80 -80 -1234
15
lecture 615 SOURCE FIELDRECEIVING FIELD PICTUREVALUEPICTUREVALUE S9(4) 1234 S9(4) 0123 S9(4)-1234 S9(4) 1234 S9(4) 0123 S9(4)-1234 S9(4) 1234 S9(4)-1234 ++,++++1,234 ++,+++ +123 ++,+++-1,234 --,--- 1,234 --,--- 123 --,----1,234 ZZ,ZZ9+ 1,234+ ZZ,ZZ9- 1,234- a. b. c. d. e. f. g. h.
16
lecture 616 Summary, B 0 / Simple Insertion. Special Insertion + - $ Fixed Insertion + - $ Floating Insertion Z * Suppression and Replacement, B 0 / Simple Insertion. Special Insertion + - $ Fixed Insertion + - $ Floating Insertion Z * Suppression and Replacement Edit Symbol Editing Type
17
lecture 617 More Examples SOURCE FIELDRECEIVING FIELD PICTUREVALUEPICTUREVALUE 9(4)0678 9(4)0678 9(4)0678 9(4)V99123456 9(4)V99123456 9(4)V99123456 9(4)0008 9(4)V912345 9(4)V912345 9(5)00045 9(9)123456789 9(4)1234 9(6)080594 9(6)080594 z(4) 678 $9(4)$0678 $Z(4)$ 678 9(4).991234.56 $9(4).99$1234.56 $9,999.99$1,234.56 $$,$$9 $8 9(4)1234 9(4).991234.50 $****9$***45 999B99B9999123 45 6789 $$,$$9.00$1,234.00 99/99/9908/05/94 Z9/99/99 8/05/94 a. b. c. d. e. f. g. h. i. j. k. l. m. n.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.