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

How to insert space


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

New User


Joined: 20 Sep 2006
Posts: 23
Location: Chennai

PostPosted: Fri Jun 13, 2008 5:27 pm
Reply with quote

following is my input file

senthil
kumar



i wants o/p file as

s e n t h i l
k u m a r.

Give me a sample program.
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Fri Jun 13, 2008 5:38 pm
Reply with quote

Quote:
Give me.


That's very nice.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Jun 13, 2008 5:39 pm
Reply with quote

itdsen wrote:
following is my input file

senthil
kumar



i wants o/p file as

s e n t h i l
k u m a r.

Give me a sample program.


Don't demand.

Simple loop with move and reference modification.

I shouldn't do this but here goes.

Code:
move spaces to target.
perform varying x from 1 by 1 until x > length of source
     move source (x : 1) to target ((x * 2) - 1 : 1)
end-perform
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Fri Jun 13, 2008 5:47 pm
Reply with quote

Craq - getting weak. Friday, right?
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Jun 13, 2008 5:53 pm
Reply with quote

Phrzby Phil wrote:
Craq - getting weak. Friday, right?


Yes it's been a long week and I'm getting weak in my old age.
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts Insert system time/date (timestamp) u... DFSORT/ICETOOL 5
No new posts Identify Program Insert DB2 7
No new posts Insert trailer for non empty file only DFSORT/ICETOOL 6
Search our Forums:

Back to Top