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: 992
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 Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am


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