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

Problem reading file in dynamically called module in PL/I


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
krishna_mf

New User


Joined: 31 Jan 2007
Posts: 56
Location: banglore

PostPosted: Sat Jun 23, 2007 1:27 pm
Reply with quote

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

New User


Joined: 27 Apr 2006
Posts: 48
Location: Bangalore, India

PostPosted: Sat Jun 23, 2007 9:40 pm
Reply with quote

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

New User


Joined: 31 Jan 2007
Posts: 56
Location: banglore

PostPosted: Mon Jun 25, 2007 11:44 am
Reply with quote

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

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Mon Jun 25, 2007 7:37 pm
Reply with quote

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

New User


Joined: 31 Jan 2007
Posts: 56
Location: banglore

PostPosted: Tue Jun 26, 2007 6:19 pm
Reply with quote

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

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Tue Jun 26, 2007 7:02 pm
Reply with quote

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

New User


Joined: 31 Jan 2007
Posts: 56
Location: banglore

PostPosted: Wed Jun 27, 2007 1:39 pm
Reply with quote

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

New User


Joined: 02 Aug 2007
Posts: 6
Location: Denver

PostPosted: Mon Aug 06, 2007 12:09 am
Reply with quote

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

New User


Joined: 02 Aug 2007
Posts: 6
Location: Denver

PostPosted: Mon Aug 06, 2007 12:11 am
Reply with quote

R u passing the parameters directly to the sub program? If so then try using pointers to pass the parms.
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: Mon Aug 06, 2007 1:43 am
Reply with quote

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
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 -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top