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

Writing to the same file from assembler and PLI


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

New User


Joined: 26 Apr 2010
Posts: 73
Location: India

PostPosted: Mon Sep 27, 2010 7:57 pm
Reply with quote

Hello Team,

I am having a PLI module which is having a file declaration in OUTPUT mode. From the PLI I am calling an assembler module in a loop which is actually writing to the file. The problem is that if I am writing to the file only from the ASSEMBLER or PLI , the contents are there. But if I am trying to write from both the PLI and the ASSEMBLER, it retains the contents written from PLI only. Could you please tell me why this happens and how it can be overcome. Is the FILE open in OUTPUT mode in PLI is the problem. ?
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Mon Sep 27, 2010 8:09 pm
Reply with quote

I think the problem is due to the fact that the PL/1 program and Assembler program have separate DCBs. Since the PL/1 DCB is the last accessed/closed, anything written to the Assembler programs DCB gets lost.

The solution? There is none - only one program can safely access the file.

Garry.
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 Sep 27, 2010 8:45 pm
Reply with quote

Hello,

Instead of writing in the pl/i code, call the assembler with the record to be written and let the assembler code actually issue the write.

The assembler would need to be changed to determine if the invocation was a "write-only" request or the original processing request. Change the parameter list to add a new first-parm to indicate which process is being invoked (or change the assembler to have multiple entry points - for simplicity, you may want to just add the new parm).
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 1
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
Search our Forums:

Back to Top