Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Problem reading file in dynamically called module in PL/I

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: Problem reading file in dynamically called module in PL/I
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    Post subject: Re: problem reading file in dynamically called module in PL/
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    Post subject:
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: 1105
Location: The Netherlands at Hole 19

PostPosted: Mon Jun 25, 2007 7:37 pm    Post subject:
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    Post subject: Re: Problem reading file in dynamically called module in PL/
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: 1105
Location: The Netherlands at Hole 19

PostPosted: Tue Jun 26, 2007 7:02 pm    Post subject:
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    Post subject:
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    Post subject: Re: Problem reading file in dynamically called module in PL/
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    Post subject: Re: Problem reading file in dynamically called module in PL/
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

Site Director


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

PostPosted: Mon Aug 06, 2007 1:43 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts ICETOOL - RESIZE DYNAMICALLY kranthikumarb DFSORT/ICETOOL 0 Tue Nov 21, 2017 5:30 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us