Concatenate Input fields with string without Spaces



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

Concatenate Input fields with string without Spaces

Postby bmc444 » Tue Aug 28, 2018 2:44 pm

Im struggling with the following task: Concatenate all three alphanumeric input fields with STRING. Leading and trailing spaces have to be removed. Note: Here you can use the function TRIM() if you find no other solution.

Thats how it should look like:
Input Alphanum. . 1: This string is
Input Alphanum. . 2: concatenated.
Input Alphanum. . 3:

Alphanum. output 1: This string isconcatenated.
Alphanum. output 2:

The only problem I have right now is that I can't find a way to remove the spaces between the two inputs. Either the spaces are gone but he only takes part of the 2nd input or they are just 20 spaces apart.
bmc444
 
Posts: 1
Joined: Tue Aug 28, 2018 2:40 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Concatenate Input fields with string without Spaces

Postby Terry Heinze » Tue Aug 28, 2018 6:47 pm

If you are not restricted to using STRING, you could get the desired result using REFERENCE MODIFICATION.
.... Terry
Terry Heinze
 
Posts: 239
Joined: Wed Dec 04, 2013 11:08 pm
Location: Richfield, MN, USA
Has thanked: 12 times
Been thanked: 11 times

Re: Concatenate Input fields with string without Spaces

Postby NicC » Tue Aug 28, 2018 7:10 pm

Locked as answered on another forum. We do noe want to waste our time.
Brian, do NOT post on multiple forums.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post