View previous topic :: View next topic
|
Author |
Message |
PRV
New User
Joined: 16 Apr 2009 Posts: 15 Location: Pune
|
|
|
|
Code: |
FILE FILE01 VB (10566 21136)
SV 1 5 P. CM 6 8 P.
LTR 265 2 P. IS 267 10296 A.
*WORKING STORAGE
HN W 10296 A.
H1 HN 104 A OCCURS (99) INDEX IDX1.
HC H1 +6 3 A.
CTR W 2 P.
FILE FILE02 FB (25 2500)
FCTR 1 2 N.
FD 3 9 A.
FM 12 14 A.
*
JOB INPUT FILE01
HN = IS
IDX1 = 0
CTR = 1
DO WHILE CTR LE LTR
DISPLAY 'LTR :' LTR
DISPLAY 'CM:' CM
DISPLAY 'FD:' FD
FCTR = LTR
FM = CM
FD = SV
PUT FILE02
CTR = CTR + 1
IDX1 = IDX1 + 104
END-DO
GOTO JOB
**************************** Bottom of |
I am getting error message
*******A006 PROGRAM INTERRUPT - CODE 4 (PROTECTION EXCP)
at line HN = IS
Please help me to remove this error |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
i am not sure, but in most languages, if you assign a register,
Code: |
H1 HN 104 A OCCURS (99) INDEX IDX1 |
you increment OCCURances which internally determines the displacement
my guess would be to change the above to:
|
|
Back to top |
|
|
PRV
New User
Joined: 16 Apr 2009 Posts: 15 Location: Pune
|
|
|
|
I tried ...still I am getting same error message. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I suspect that your code is trying to move more bytes than exist. . .
The file is specified to be variable, but the move is fixed for the max length. . . |
|
Back to top |
|
|
PRV
New User
Joined: 16 Apr 2009 Posts: 15 Location: Pune
|
|
|
|
Yes...That is true.
is there any way to move variable length field in the variable length working storage variable..
If yes...how would be the declaration of woring storage variable.
Please advice.
Thanks.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
is there any way to move variable length field in the variable length working storage variable.. |
Certainly - but you have to provide the definition that describes the file. We probably can't help with that. . .
It may be that the array should be defined in the Easytrieve file layout.
How does a cobol copybook for this file defined? The Easytrieve layout needs to be the same. |
|
Back to top |
|
|
|