View previous topic :: View next topic
|
Author |
Message |
nagarajan.dharani
New User
Joined: 27 Dec 2006 Posts: 36 Location: Chennai
|
|
|
|
Hi,
Can anyone help me out for my below requirement.
Input Copy book Layout :
01 DCL-FPLC
05 FPLC-FRNCHS-CD
05 FPLC-PLN-CTRL-ID
05 FPLC-PLN-CD
05 FPLC-YR
I have to move the above values to the below record using redefines.
01 INP-PLNCD-FILE-REC
Please share your thoughts with me.
Thanks,
Dhrani N. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
dharani,
Your requirement is not clear at all. |
|
Back to top |
|
|
nagarajan.dharani
New User
Joined: 27 Dec 2006 Posts: 36 Location: Chennai
|
|
|
|
I have defined in file section like below
FILE SECTION.
FD INP-PLNCD-FILE
RECORDING MODE IS F
BLOCK CONTAINS 0 RECORDS
LABEL RECORDS ARE STANDARD.
01 INP-PLNCD-FILE-REC PIC X(182).
The layout of the input file is in copy book
01 DCL-FPLC
05 FPLC-FRNCHS-CD
05 FPLC-PLN-CTRL-ID
05 FPLC-PLN-CD
05 FPLC-YR
Now the values of 01 DCL-FPLC have to be moved 01 INP-PLNCD-FILE-REC
01 DCL-FPLC |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
dharani,
Do a direct move. |
|
Back to top |
|
|
nagarajan.dharani
New User
Joined: 27 Dec 2006 Posts: 36 Location: Chennai
|
|
|
|
I should not do direct move. All the values have to be assigned using redefines. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
dharani,
Hit 'submit' button too early.
INP-PLNCD-FILE is an input file or output. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Quote: |
I should not do direct move. All the values have to be assigned using redefines. |
Any reason for this. |
|
Back to top |
|
|
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 275 Location: Bang,iflex
|
|
|
|
Hi Nagraj,
Quote: |
01 INP-PLNCD-FILE-REC PIC X(182).
The layout of the input file is in copy book
01 DCL-FPLC
05 FPLC-FRNCHS-CD
05 FPLC-PLN-CTRL-ID
05 FPLC-PLN-CD
05 FPLC-YR
Now the values of 01 DCL-FPLC have to be moved 01 INP-PLNCD-FILE-REC
01 DCL-FPLC |
Your quetion is still not clear, still, if the input file record structure matches with the shown record structure(means picture class should be matched in both the structure) then you can go for corressponding move statement.
As Murali said, you can go for direct move also. |
|
Back to top |
|
|
nagarajan.dharani
New User
Joined: 27 Dec 2006 Posts: 36 Location: Chennai
|
|
|
|
I should not do direct move. All the values have to be assigned using redefines. |
|
Back to top |
|
|
nagarajan.dharani
New User
Joined: 27 Dec 2006 Posts: 36 Location: Chennai
|
|
|
|
Hi,
How can we Redefine 01 level variable in copy book.
That is,
COPY <copyname> redefine ??????? |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
dharani,
Please note that we can't read your mind (as you cant read ours). After this many posts, you are yet to come with your actual requirement. |
|
Back to top |
|
|
raak
Active User
Joined: 23 May 2006 Posts: 166 Location: chennai
|
|
|
|
Quote: |
I should not do direct move. All the values have to be assigned using redefines. |
What is the point u r trying to convey??
Quote: |
if the input file record structure matches with the shown record structure(means picture class should be matched in both the structure) then you can go for corressponding move statement. |
isn't this ok??
or please give a detailed explanation on what u want and why u want it so??[/quote] |
|
Back to top |
|
|
revel
Active User
Joined: 05 Apr 2005 Posts: 135 Location: Bangalore/Chennai-INDIA
|
|
|
|
Hi Dhrani,
Quote: |
FILE SECTION.
FD INP-PLNCD-FILE
RECORDING MODE IS F
BLOCK CONTAINS 0 RECORDS
LABEL RECORDS ARE STANDARD.
01 INP-PLNCD-FILE-REC PIC X(182).
The layout of the input file is in copy book
01 DCL-FPLC
05 FPLC-FRNCHS-CD
05 FPLC-PLN-CTRL-ID
05 FPLC-PLN-CD
05 FPLC-YR |
Quote: |
Now the values of
01 DCL-FPLC have to be moved 01 INP-PLNCD-FILE-REC |
You can't redefines a variable in FD SECTION
That is DCL-FPLC with INP-PLNCD-FILE-REC <in FD SECTION>
It will internally Redefines incase if you are using COPY BOOK
Code: |
01 DCL-FPLC
05 FPLC-FRNCHS-CD
05 FPLC-PLN-CTRL-ID
05 FPLC-PLN-CD
05 FPLC-YR |
after 01 INP-PLNCD-FILE-REC PIC X(182).
If it in WORKING-STOARAGE SECTION, then you can do it
This topic is discussed many times in forum |
|
Back to top |
|
|
nagarajan.dharani
New User
Joined: 27 Dec 2006 Posts: 36 Location: Chennai
|
|
|
|
Let me know how we can redefine working storage section |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Dharani,
Quote: |
Let me know how we can redefine working storage section |
RTMF.
Is this is a HOMEWORK? |
|
Back to top |
|
|
Varun Singh
New User
Joined: 01 Aug 2007 Posts: 25 Location: Delhi
|
|
|
|
01 A PIC 9(20).
01 B REDEFINES A
05 C PIC 9(05).
05 D PIC 9(10).
05 E PIC 9(05).
I think this might help you |
|
Back to top |
|
|
revel
Active User
Joined: 05 Apr 2005 Posts: 135 Location: Bangalore/Chennai-INDIA
|
|
|
|
Hi nagaraj,
You can redefine in this way
Code: |
01 WS-A PIC X(80).
01 WS-B REDEFINES WS-A PIC 9(80). |
You can get in every COBOL Book,
Try to read manul before posting |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
revel wrote: |
01 WS-B REDEFINES WS-A PIC 9(80).
You can get in every COBOL Book,
Try to read manul before posting |
Good idea, the max size of a numeric item is 18 or 31 depending on your compiler options. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi,
You said:
Quote: |
I have defined in file section like below
FILE SECTION.
FD INP-PLNCD-FILE
RECORDING MODE IS F
BLOCK CONTAINS 0 RECORDS
LABEL RECORDS ARE STANDARD.
01 INP-PLNCD-FILE-REC PIC X(182).
The layout of the input file is in copy book
01 DCL-FPLC
05 FPLC-FRNCHS-CD
05 FPLC-PLN-CTRL-ID
05 FPLC-PLN-CD
05 FPLC-YR
Now the values of 01 DCL-FPLC have to be moved 01 INP-PLNCD-FILE-REC
01 DCL-FPLC |
If you code:
Quote: |
FILE SECTION.
FD INP-PLNCD-FILE
RECORDING MODE IS F
BLOCK CONTAINS 0 RECORDS
LABEL RECORDS ARE STANDARD.
01 INP-PLNCD-FILE-REC PIC X(182).
COPY your-copybk name |
Beleive it or not, every read of the file will "move" the values of 01 DCL-FPLC to 01 INP-PLNCD-FILE-REC. |
|
Back to top |
|
|
|