View previous topic :: View next topic
|
Author |
Message |
krishna_mf
New User
Joined: 31 Jan 2007 Posts: 56 Location: banglore
|
|
|
|
hi
i am trying to read a file in a dynamic procedure but the program is abended with soc4. can't we read/write file in dynamically called module using fetch and release in PL/I |
|
Back to top |
|
|
amrita.chatterjee
New User
Joined: 27 Apr 2006 Posts: 48 Location: Bangalore, India
|
|
|
|
yeah u can read/write from/to a file in dynamically called module also. May be S0C4 is coming for different reason. just add display statement & see for which statement S0C4 is coming. |
|
Back to top |
|
|
krishna_mf
New User
Joined: 31 Jan 2007 Posts: 56 Location: banglore
|
|
|
|
hi,
i am getting error only at read statment. the first put skip(FILE OPEN SUCCESSFUL) is gettign printed in output after that i am getting abend soc4.
ONCODE=8094 Protection exception
From compile unit RWFILE at entry point RWFILE at compile unit offset
below is my dynamic module.
RWFILE:PROC OPTIONS(FETCHABLE);
DCL 1 PERS_DET,
2 PERS_NAME CHARACTER(4),
2 PERS_AGE CHARACTER(2),
2 PERS_SEX CHARACTER(6),
2 FILLER CHARACTER(68);
DCL END_OF_FILE BIT(1);
DCL ENDFILE BUILTIN;
DCL TEMPVAR CHAR(80) VARYING;
DCL INPUTD FILE RECORD;
DCL OUTPUTD FILE RECORD;
OPEN FILE (INPUTD) INPUT;
ON ENDFILE(INPUTD) END_OF_FILE = '0'B;
OPEN FILE (OUTPUTD) OUTPUT;
PUT SKIP LIST('FILE OPEN SUCCESSFUL ');
END_OF_FILE='1'B;
DO WHILE(END_OF_FILE);
READ FILE(INPUTD) INTO (PERS_DET);
PUT SKIP LIST('DATA IN FILE '||PERS_DET);
WRITE FILE(OUTPUTD) FROM (PERS_DET);
END;
CLOSE FILE(INPUTD);
CLOSE FILE(OUTPUTD);
END RWFILE; |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
Are caller and callee both running in upper or lower memory? I mean; do the both have the same AMODE? If the caller runs AMODE=31 and the callee runs AMODE=24 a S0C4 often occurs because of addressing problems. |
|
Back to top |
|
|
krishna_mf
New User
Joined: 31 Jan 2007 Posts: 56 Location: banglore
|
|
|
|
how to know the AMODE of program? i compiled the two programs using th same JCL how can the AMODE be different? |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
This how I normally define structures.
Code: |
DCL PERS_DET_INP CHAR(80);
DCL 1 PERS_DET BASED(ADDR(PERS_DET_INP)),
2 PERS_NAME CHARACTER(4),
2 PERS_AGE CHARACTER(2),
2 PERS_SEX CHARACTER(6),
2 FILLER CHARACTER(68);
READ FILE(INPUTD) INTO(PERS_DET_INP);
|
|
|
Back to top |
|
|
krishna_mf
New User
Joined: 31 Jan 2007 Posts: 56 Location: banglore
|
|
|
|
hi,
i think even if u decalre a direct structre or if you base it on different strucure it doesnt matter. I am still getting the same abend code soc4.
so
DCL 1 PERS_DET,
2 PERS_NAME CHARACTER(4),
2 PERS_AGE CHARACTER(2),
2 PERS_SEX CHARACTER(6),
2 FILLER CHARACTER(68);
READ FILE(INPUTD) INTO (PERS_DET);
is same as
DCL PERS_DET_INP CHAR(80);
READ FILE(INPUTD) INTO(PERS_DET_INP); |
|
Back to top |
|
|
Sivkumar Srinivasan
New User
Joined: 02 Aug 2007 Posts: 6 Location: Denver
|
|
|
|
Hi Krishna u can normally find ur amode details in the FLINKS for the respective programs. But y r u using a dynamic call? It is always better to use a static call as it is much faster and safer. Please check if the passing parameters mentioned in both the calling program and the called program are the same. Sometimes it goes unnoticed |
|
Back to top |
|
|
Sivkumar Srinivasan
New User
Joined: 02 Aug 2007 Posts: 6 Location: Denver
|
|
|
|
R u passing the parameters directly to the sub program? If so then try using pointers to pass the parms. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
This
Quote: |
It is always better to use a static call |
is not necessarily true.
In fact, many sites prefer dynamic calls over static calls.
If a common sub-routine (say a date arithmetic or specialized calculation routine) is called by only 25 modules all 25 must be recompiled and/or relinked for any change to the common subroutine. |
|
Back to top |
|
|
|