Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
String command in COBOL to concatenate to names

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sreekusr
Warnings : 1

New User


Joined: 28 Aug 2006
Posts: 54
Location: Madrid

PostPosted: Mon Jan 08, 2007 3:06 pm    Post subject: String command in COBOL to concatenate to names
Reply with quote

Hi,

I want to use STRING command to do the following.

First Name (20) - SREE RAM
secon name(20) - SHYAM BOSS

can any one provide me the STRING command to get the following Result.

O/p- SREE RAM SHYAM BOSS

Thanks,
Sree
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Mon Jan 08, 2007 3:22 pm    Post subject:
Reply with quote

Hi Sree,

Code:
STRING First Name
       DELIMITED BY SIZE       
       ' '     
       secon name
       DELIMITED BY SIZE       
       INTO   WS-VAR
Back to top
View user's profile Send private message
sreekusr
Warnings : 1

New User


Joined: 28 Aug 2006
Posts: 54
Location: Madrid

PostPosted: Mon Jan 08, 2007 3:26 pm    Post subject: Re: Strings in COBOL
Reply with quote

hi,

thanks a lot Ekta ..i will try it out.

Regards,
Sree
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Mon Jan 08, 2007 3:35 pm    Post subject: Re: Strings in COBOL
Reply with quote

sreekusr wrote:
I want to use STRING command to do the following.
First Name (20) - SREE RAM
secon name(20) - SHYAM BOSS
O/p- SREE RAM SHYAM BOSS

Assuming that names might have single spaces imbeded but not two or more imbeded spaces:
Code:
string first delimited by '  '
       space delimited by size
       second delimited by '  '
   into outarea

should work....
Back to top
View user's profile Send private message
sreekusr
Warnings : 1

New User


Joined: 28 Aug 2006
Posts: 54
Location: Madrid

PostPosted: Mon Jan 08, 2007 4:37 pm    Post subject: Re: Strings in COBOL
Reply with quote

Thank you Mr.William .

It worked.

Regards
Sree
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 MQ command in option 6 of ISPF! Vignesh Sid All Other Mainframe Topics 3 Tue Sep 26, 2017 6:01 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us