Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Read command with SET and INTO working differently in PL1

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
anjani shanker

New User


Joined: 26 Jan 2007
Posts: 37
Location: USA

PostPosted: Wed Feb 23, 2011 7:43 am    Post subject: Read command with SET and INTO working differently in PL1
Reply with quote

Hi -

I faced a trouble this evening where in one of my modules, where I was reading a file sequencially wasn't working fine with the "SET(REC_PTR)" clause after certain number of reads..Yes there were huge amoung of data in the file.
My module was compiled with xpeditor option as Y. When i changed the read stmt to "INTO(REC_VAR)" instead of set, it was working fine. The read was performed in the one of the called modules and the record variable was allocated in the main module. Also want to bring this into the attention that the read wasn't going down but it was carrying some values it had already read from the file long back..Was this storage overlay issue or something else? Could you also forward me some links where i could study more about this?
Back to top
View user's profile Send private message

Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 991
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Feb 23, 2011 1:10 pm    Post subject:
Reply with quote

Quote:
The read was performed in the one of the called modules and the record variable was allocated in the main module.


This is likely where your issue lies. READ SET(REC_PTR) sets the address of REC_PTR to the record in the I/O buffer - it does not move data into a record variable.

How is the record variable declared and how is the READ issued?

Without seeing your code it's not possible to see how you're managing to cause this situation. It looks like you have a 'short' buffer and are managing to address records that are from a previous buffer when you reach end-of-file.

Garry.
Back to top
View user's profile Send private message
anjani shanker

New User


Joined: 26 Jan 2007
Posts: 37
Location: USA

PostPosted: Wed Feb 23, 2011 9:49 pm    Post subject:
Reply with quote

I have attached the piece of code. In MXXXX below
READ FILE(INFILE) INTO(K406); returns correct value
but when i used
READ FILE(INFILE) SET(REC_PTR); after being called sometimes it started returning some old values which were read earlier and not a part of current read.


Main Module:

Code:
DCL                               
  1 CNTL_REC       BASED(CNTL_PTR),
  % INCLUDE SYSLIB  (K406PAB );   

DCL               
  CNTL_PTR POINTER;

Inside my logic i call MXXXX couple of times which performs the read.

Code:
CALL MXXXX(EOF,CNTL_PTR,CUR_ST_AGT);

Called Module, MXXXX:
Code:
MXXXX:                                 
 PROC (EOF,REC_PTR,CUR_ST_AGT) REORDER;
DCL                       
  INFILE FILE INPUT RECORD
  ENV( FB,RECSIZE(250)); 

DCL                     
  1 K406 BASED(REC_PTR),
% INCLUDE SYSLIB  (K406PAB );   

% SKIP(001);                   
   ON ENDFILE(INFILE)         
     EOF = '1'B;               
   IF FIRST_CALL THEN         
    DO;                       
     OPEN FILE(INFILE);       
     FIRST_CALL = '0'B;       
    END;                       
    READ FILE(INFILE) INTO(K406);
    CUR_ST_AGT = K406.CUR_ST_AGT;
Back to top
View user's profile Send private message
prino

Active Member


Joined: 07 Feb 2009
Posts: 989
Location: Oostende, Belgium

PostPosted: Wed Feb 23, 2011 10:37 pm    Post subject:
Reply with quote

These snippets of code do not contain any useful information.
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 991
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Feb 24, 2011 12:16 pm    Post subject:
Reply with quote

Quote:
These snippets of code do not contain any useful information.


...and, since there's no definitive value in the calling module's CNTL_PTR which is passed to the called program as REC_PTR, the READ INTO is liable to result in a S0C4 abend.

Garry.
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 Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
No new posts CICS VSAM RLS READ akodakka CICS 3 Tue Oct 04, 2016 3:09 pm
No new posts SDSF Command Avtrix CLIST & REXX 4 Fri Sep 30, 2016 11:13 am
No new posts How to find a CICS resource used in C... Arunkumar Chandrasekaran CICS 8 Thu Sep 29, 2016 1:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us