Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Concatenate VAR-1 and VAR-2 to get the VAR-3
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: 3158
Location: Tucson AZ

PostPosted: Wed Apr 11, 2007 9:13 pm    Post subject: Re: STRING manipulation in COBOL
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Wed Apr 11, 2007 9:26 pm    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Thu Apr 12, 2007 12:28 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Concatenate different LRECL GDG's Rohit Umarjikar DFSORT/ICETOOL 6 Wed Nov 18, 2015 3:30 am
No new posts Concatenate 2 different VB files to a... santhosh5983 DFSORT/ICETOOL 8 Sat Oct 10, 2015 2:12 am
No new posts How to concatenate a dataset with SYS... swathykrishnan CLIST & REXX 8 Tue Sep 01, 2015 6:08 pm
No new posts how to concatenate two cobol loadlib ... boyti ko CLIST & REXX 2 Mon Jun 29, 2015 4:41 pm
No new posts Sort card to concatenate two records ... sakrat DFSORT/ICETOOL 27 Thu Apr 23, 2015 2:53 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us