|
From: Eric Tubbs <eatubbs@email.com> ===> try to make it smaller :-). >The last field in your record is not 7 characters long, but shorter. >You can figure out what the size is from the manual or from a bit >of thinking. 0033.00 01 CUSTOMER-TRANSACTION RECORD. 0034.00 05 CT-FIRST-NAME PIC X(10). 0035.00 05 CT-MIDDLE-INITIAL PIC X(01). 0036.00 05 CT-LAST-NAME PIC X(15). 0037.00 05 CT-TRANSACTION-MONTH PIC X(09). 0038.00 05 CT-TRANSACTION-AMOUNT PIC 9(07)V99 PACKED-DECIMAL. this guy has a record length of 10+1+15+9+(7+2+1)/2 = 40 (on most machines). The only difficulty is the size of the packed decimal. Each digit takes up 4 bits, so two digits per byte. The sign is coded in a separate 4-bit field and if all this result in an odd number of 4-bit fields and extra 4 bits are appended to full up the last byte. 0040.00 FD CUSTOMER-TRANSACTION-REPORT 0041.00 RECORD CONTAINS 80 CHARACTERS. 0042.00 0043.00 01 PRINT-RECORD-OUT. 0044.00 05 PIC X(04). 0045.00 05 DL-FIRST-NAME PIC X(10). 0046.00 05 PIC X(02). 0047.00 05 DL-LAST-NAME PIC X(15). 0048.00 05 PIC X(08). 0049.00 05 DL-TRANSACTION-MONTH PIC X(09). 0050.00 05 PIC X(18). 0051.00 05 DL-TRANSACTION-AMOUNT PIC 9(07).99. 0052.00 05 PIC X(04). this guy adds up to 90, because the decimal point is included in the picture 9(07).99. If you use this picture: 9(07)V99, the decimal point is a "virtual" point and it not stored. The code "knows" that it is there and can adjust for it. when I attempt the following, it just gives me the MCH1202 error. Any leads? ===> you have to move valid data to the field first. Where could I might find examples on how to use the PIC effectively ===> try this: http://www.csis.ul.ie/COBOL/Course/DataDeclaration.htm
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.