View previous topic :: View next topic
|
Author |
Message |
shakthyp
New User
Joined: 10 Sep 2008 Posts: 6 Location: Chennai,India
|
|
|
|
how do i read input file record into 2 different records of the same format.
for eg if i need to read the file INP-FILE into WS-REC1 and WS-REC 2 |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
READ INTO
and
MOVE |
|
Back to top |
|
|
shakthyp
New User
Joined: 10 Sep 2008 Posts: 6 Location: Chennai,India
|
|
|
|
That is not working since both the records have many redefines clause. I tried moving it this way
MOVE CORRESPONDING WS-REC1 to WS-REC2
But this way also it is not working.... |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
MOVE CORRESPONDING only moves fields with the same name and structure; unless there's a lot of name duplication I can see why it wouldn't work.
Why don't you just READ and put both definitions in the FD? I don't normally recommend working in the buffer but there are times when it can be handy. |
|
Back to top |
|
|
shakthyp
New User
Joined: 10 Sep 2008 Posts: 6 Location: Chennai,India
|
|
|
|
Could you please be more clear on using the FD? Im sorry i have not used it earlier. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hello,
You can specify multiple record layouts for a file in FD one after the other. Each layout will be an implicit redefinition of the original layout.
Arun |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
shakthyp wrote: |
That is not working ... |
How is "that" not working needs more explanation, also I didn't understand this
Quote: |
2 different records of the same format. |
from your very first post..
From other suggestions it seems that to have multiple (two for this thread)"01" level records can be your choice but if so why would you move values from WS-REC1 to WS-REC2, they are two different "layout" for the same record.. |
|
Back to top |
|
|
|