IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Concatenate VAR-1 and VAR-2 to get the VAR-3


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Harshavardhana

New User


Joined: 09 Mar 2007
Posts: 7
Location: India

PostPosted: Wed Apr 11, 2007 9:07 pm
Reply with quote

Hi Friends,

I have the following variables:

01 VAR-1 PIC X(15) VALUE 'AAAAA '.
01 VAR-2 PIC X(05) VALUE '11111'.
01 VAR-3 PIC X(10) VALUE SPACES.


Now, I need to concatenate VAR-1 and VAR-2 to get the VAR-3 with the value 'AAAAA11111'.

Is there a way to achieve this in COBOL?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Apr 11, 2007 9:13 pm
Reply with quote

Harshavardhana wrote:
Is there a way to achieve this in COBOL?
Yes, with the STRING statement.
Back to top
View user's profile Send private message
Harshavardhana

New User


Joined: 09 Mar 2007
Posts: 7
Location: India

PostPosted: Wed Apr 11, 2007 9:17 pm
Reply with quote

Hi William,

Thank you for providing me with the link for STRING statement.
I could not get the required answer in the link.

Could you please tell me how to achieve this using the STRING statement?

Thanks.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Apr 11, 2007 9:26 pm
Reply with quote

Did you look at the example and explanation for Figure 17 (the example is just above the figure)?
Back to top
View user's profile Send private message
Harshavardhana

New User


Joined: 09 Mar 2007
Posts: 7
Location: India

PostPosted: Wed Apr 11, 2007 10:30 pm
Reply with quote

Yes...!, I could see the example. I also used the same in my pgm and I got what I required.

Thank You very much William.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Apr 12, 2007 12:28 am
Reply with quote

Harshavardhana wrote:
Yes...!, I could see the example. I also used the same in my pgm and I got what I required.
Bless you heart for trying, and have a happy day.... icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
No new posts concatenate sysin to dsn JCL & VSAM 7
No new posts Need help to concatenate files with w... All Other Mainframe Topics 3
No new posts Concatenate two files of variable rec... DFSORT/ICETOOL 3
No new posts Is possible to concatenate multiple P... DFSORT/ICETOOL 6
Search our Forums:

Back to Top