IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

PROGRAM INTERRUPT - CODE 4


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
PRV

New User


Joined: 16 Apr 2009
Posts: 15
Location: Pune

PostPosted: Wed Apr 22, 2009 4:04 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Apr 22, 2009 4:47 pm
Reply with quote

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
Code:
IDX1 = IDX1 + 104

my guess would be to change the above to:
Code:
IDX1 = IDX1 + 1
Back to top
View user's profile Send private message
PRV

New User


Joined: 16 Apr 2009
Posts: 15
Location: Pune

PostPosted: Wed Apr 22, 2009 5:16 pm
Reply with quote

I tried ...still I am getting same error message.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Apr 22, 2009 8:35 pm
Reply with quote

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
View user's profile Send private message
PRV

New User


Joined: 16 Apr 2009
Posts: 15
Location: Pune

PostPosted: Fri Apr 24, 2009 12:03 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Apr 24, 2009 7:16 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
Search our Forums:

Back to Top