Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
I want to copy data from previous line to new line

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
scorp_rahul23

New User


Joined: 06 May 2008
Posts: 13
Location: Chennai

PostPosted: Mon Jun 23, 2008 3:37 pm    Post subject: I want to copy data from previous line to new line
Reply with quote

I have input file like from column 1-80 is one part and 80 to 160 is another part

Code:


Karan                               
Mohan                   
Mohan                  1234
Sumit                   
Sumit                   5648




I want my output file as
Code:


Karan                               
Mohan                  1234
Sumit                   5648


Checking for part from 80-160, if it is spaces then
I have to check in next line whether part 1 to 80 is same, and if it is same I have to write second line not the first.
And if it is not same then I have to write first line

Can anyone help me on this
Back to top
View user's profile Send private message
References
PostPosted: Mon Jun 23, 2008 3:37 pm    Post subject: Re: I want to copy data from previous line to new line Reply with quote

cvadlamudi

Active User


Joined: 19 Apr 2007
Posts: 54
Location: India

PostPosted: Mon Jun 23, 2008 4:27 pm    Post subject: Re: I want to copy data from previous line to new line
Reply with quote

Hi,

Sort the file first using
Sort fields=(1,80,ch,a,81,80,ch,a).. this will bring the records with the spaces first...
and remove all the first duplicate records
Back to top
View user's profile Send private message
ssk1711

New User


Joined: 16 Jun 2008
Posts: 29
Location: bangalore

PostPosted: Mon Jun 23, 2008 4:42 pm    Post subject: Re: I want to copy data from previous line to new line
Reply with quote

hi Raghul,

scorp_rahul23 wrote:
I have input file like from column 1-80 is one part and 80 to 160 is another part


can you be bit clear on this statement.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 1504
Location: germany

PostPosted: Mon Jun 23, 2008 5:06 pm    Post subject:
Reply with quote

scorp_rahul23,

could there be three records with the same 1-80;
1st is spaces 81-160
2nd is filled 81-160 fill = abc
3rd is filled 81-160 fill = def

??????????
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1