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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts A not very Christmassy PL/I tale, wit... prino PL/I & Assembler 3 Mon Dec 26, 2016 1:01 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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