Printing side by side dublicate data.



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Printing side by side dublicate data.

Postby Vladblood » Mon Jan 23, 2017 11:41 pm

I'm writing code to produce mailing lists from data (Name, address) in a file. I was able to create a program that prints the data twice one after another. The second program I want to print the data side by side, but when I compile I get an error that the data is not unique.
Here is a sample of a line I want to be printed.

01 MAIL-LABEL-LINE1.                                    
     05                         PIC X(5)     VALUE SPACES.
     05 ML1-CNAME               PIC X(20).                
     05                         PIC X(5)     VALUE SPACES.
     05 ML1-CNAME               PIC X(20).                
     05                         PIC X(30)    VALUE SPACES.


If someone could help me I would appreciate it.

Edited by moderator to include code tags and therefor correct indentation
Vladblood
 
Posts: 1
Joined: Mon Jan 23, 2017 11:26 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Printing side by side dublicate data.

Postby Robert Sample » Tue Jan 24, 2017 12:35 am

Either use unique names for the first and second variables on a single line, or use arrays. These are the easiest ways to do what you want.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post