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
 

 

Writing to the same file from assembler and PLI

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

New User


Joined: 26 Apr 2010
Posts: 74
Location: India

PostPosted: Mon Sep 27, 2010 7:57 pm    Post subject: Writing to the same file from assembler and PLI
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

Active Member


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

PostPosted: Mon Sep 27, 2010 8:09 pm    Post subject:
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

Site Director


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

PostPosted: Mon Sep 27, 2010 8:45 pm    Post subject:
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    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 Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am


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