View previous topic :: View next topic
|
Author |
Message |
chandra k
New User
Joined: 29 Jan 2007 Posts: 2 Location: bangalore
|
|
|
|
Hi all,
let us say if Iam reading a file (say xfile) of 192 bytes. The copybook has the following structure.
01 X pic x(192)
01 Y redefines X.
05 rectype pic X(2).
88 type1 value '01'.
88 type2 value '02'.
88 type3 value '03'.
05 recdata pic x(190).
Suppose if I have the statement
Read xfile into X
Then, can I issue a statement like
If type1 perform process-para.
My actual doubt is when we are reading into X can we check a record of Y but redefined to X ? Please clarify. thanks in advance. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Chandra,
Yes u can .
Because the area occupied by a field in a COBOL layout can be re-used for different data by redefining the original field. This does exactly what it says -- it redefines the space used by a field for another use. |
|
Back to top |
|
|
arindam111
New User
Joined: 29 Nov 2006 Posts: 27 Location: India
|
|
|
|
Of course you can. |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Hi !
You could also use:
Evaluate true
When Type-1 Perform Process-1
When Type-2 Perform Process-2
When Type-3 Perform Process-3
When Other Continue
End-Evaluate
Regards, UmeySan |
|
Back to top |
|
|
|