|
[ Converted text/html to text/plain ] Greetings again, First, all of you who have responded in the past have done a wonderful job in explaining to me the programming concepts that I have inquired about and need to learn. (Lief has put up with me the most, I guess, but his determination has helped in the long run. There probably wont be any more late Sunday nights trying to rack your brain and me not understanding it.) My programming assignment is done to the specifications of my programming execercise. The printed output of the QPRINT file is showng below: (I was able to get the vertical spacings correct) *...+....1....+....2....+....3....+....4....+....5 Tommy Trans 456 Vamp Ln Roche , NB 45678 Jane Doe ! sp; 666 Dead Zone Rancho , AZ 89567 Here is my code snippet, under the WORKING-STORAGE SECTION, that defines part of the output for the following QPRINT file: 0063.00 01 ADDRESS-LABEL. 0064.00 05 PIC X(10). 0065.00 05 DL-CITY PIC X(15). 0066.00 &! nbsp; 05 PIC X VALUE ','. 0067.00 05 PIC X(01). 0068.00 05 DL-STATE PIC X(02). 0069.00 05 ! PIC X(02). 0070.00 05 DL-ZIP-CODE PIC 9(05). The rest of my source code is stated below. I didnt want to clutter the first part of the email by reading a whole bunch of source code lines. Attempting to make it easier on you all. Thanks to all for using the +1 in the Control Line for finding the vertical spacings in the output. This handy way of checking my work is wonderful. My question today is to find out how to place the comma and everything to the right of the comma after the city name appears. The desired output is shown below: *...+....1....+....2....+....3....+....4....+....5 Tommy Trans 456 Vamp Ln Roche, NB 45678 Jane Doe ! ; 666 Dead Zone Rancho, AZ 89567 Please forgive me if I dont ask this question correctly: Would it be possible, in the case of the city name, if city did not fill up the entire field length, then to have the rest of the fields shown correctly above? Thanks, Eric P.S. Here is my source code listing below: *************** Beginning of data ************************************* 0001.00 PROCESS APOST. 0002.00 0003.00 IDENTIFICATIO! N DIVISION. 0004.00 0005.00 PROGRAM-ID. CHPT0303. ! bsp; 0006.00 0007.00 ************************************************************ 0008.00 * *! bsp; 0009.00 * This program reads the Customer Address File and will * 0010.00 * print a Customer Mailing List containing the following * 0011.00 * items in this order. Each complete record will have two * 0012.00 * spaces before the next complete record starts. * 0013.00 * ! ; * 0014.00 * 1. Customer Name * 0015.00 * 2. Street Address * 0016.00 * 3. City, State, Zip ! sp; * 0017.00 * * 0018.00 ************************************************************ 0019.00 0020.00 ! bsp; ENVIRONMENT DIVISION. 0021.00 0022.00 INPUT-OUTPUT SECTION. ! 0023.00 0024.00 FILE-CONTROL. 0025.00 SELECT CUSTOMER-ADDRESS-FILE ! sp; 0026.00 ASSIGN TO DISK-CUSTADDRPF. 0027.00 0028.00 SELECT CUSTOMER-MAILING-LIST 0029.00 ! ASSIGN TO PRINTER-QPRINT. 0030.00 0031.00 DATA DIVISION. ! 0032.00 0033.00 FILE SECTION. 0034.00 ! sp; 0035.00 FD CUSTOMER-ADDRESS-FILE. 0036.00 0037.00 01 CUSTOMER-ADDRESS-DETAILS. 0038.00 05 CA-CUSTOMER-NAME PIC X(20). 0039.00! 05 STREET-NAME. 0040.00 10 CA-STREET-ADDRESS PIC X(20). 0041.00 05 ADDRESS-FROM. 0042.00 10 CA-CITY PIC X(15). 0043.00 ! bsp; 10 CA-STATE PIC X(02). 0044.00 10 CA-ZIP-CODE PIC 9(05). 0045.00 0046.00 FD CUSTOMER-MAILING-LIST. 0047.00 ! p; 0048.00 01 PRINT-RECORD-OUT PIC X(80). 0049.00 0050.00 WORKING-STORAGE SECTION. &! nbsp; 0051.00 0052.00 01 WS-CONTROL-FIELDS. 0053.00 05 ARE-THERE-MORE-RECORDS PIC X(3) VALUE 'YES'. 0054.00 0055.00 01 NAME-LABEL. &! nbsp; 0056.00 05 PIC X(10). 0057.00 05 DL-CUSTOMER-NAME PIC X(20). 0058.00 ! sp; 0059.00 01 STREET-LABEL. 0060.00 05 PIC X(10). 0061.00 05 DL-STREET-ADDRESS PIC X(20). ! ; 0062.00 0063.00 01 ADDRESS-LABEL. 0064.00 05 &! nbsp; PIC X(10). 0065.00 05 DL-CITY PIC X(15). 0066.00 05 PIC X VALUE ','. 0067.00 05 PIC X(01). 0068.00 ! ; 05 DL-STATE PIC X(02). 0069.00 05 PIC X(02). 0070.00 05 DL-ZIP-CODE PIC 9(05). 0071.00 ! 0072.00 PROCEDURE DIVISION. 0073.00 0074.00 000-MAIN-MODULE. 0075.00 ! ; 0076.00 OPEN INPUT CUSTOMER-ADDRESS-FILE 0077.00 OUTPUT CUSTOMER-MAILING-LIST. 0078.00 0079.00 READ CUSTOMER-ADDRESS-FILE ! p; 0080.00 AT END 0081.00 MOVE 'NO ' TO ARE-THERE-MORE-RECORDS 0082.00 END-READ 0083.00 PERFORM 200-PROCESS-RECORD-RTN ! sp; 0084.00 UNTIL ARE-THERE-MORE-RECORDS = 'NO '. 0085.00 0086.00 CLOSE CUSTOMER-ADDRESS-FILE 0087.00 CUSTOMER-MAILING-LIST. ! sp; 0088.00 0089.00 STOP RUN. 0090.00 ! p; 0091.00 200-PROCESS-RECORD-RTN. 0092.00 0093.00 MOVE CA-CUSTOMER-NAME TO DL-CUSTOMER-NAME. 0094.00 MOVE CA-STREET-ADDRESS TO DL-STREET-ADDRESS. 0095.00 MOVE CA-CITY TO DL-CITY. ! p; 0096.00 MOVE CA-STATE TO DL-STATE. 0097.00 MOVE CA-ZIP-CODE TO DL-ZIP-CODE. 0098.00 WRITE PRINT-RECORD-OUT FROM NAME-LABEL 0099.00 AFTER ADVANCING 1 LINE. 0100.00 WRITE PRINT-RECORD-OUT FROM STREET-LABEL 0101.00 &! nbsp; AFTER ADVANCING 1 LINE. 0102.00 WRITE PRINT-RECORD-OUT FROM ADDRESS-LABEL 0103.00 AFTER ADVANCING 1 LINE. 0104.00 MOVE SPACES TO PRINT-RECORD-OUT. 0105.00 WRITE PRINT-RECORD-OUT 0106.00 ! p; AFTER ADVANCING 2 LINE. 0107.00 READ CUSTOMER-ADDRESS-FILE 0108.00 AT END 0109.00 ! ; MOVE 'NO ' TO ARE-THERE-MORE-RECORDS 0110.00 END-READ. ****************** End of data **************************************** -- _______________________________________________ Sign-up for your own FREE Personalized E-mail at Mail.com[1] Get 4 DVDs for $.49 cents! plus shipping & processing.Click to join[2]. ===References:=== 1. http://www.mail.com/?sr=signup 2. http://adfarm.mediaplex.com/ad/ck/990-1736-3566-59
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.