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

Reading and updating same file in same step with DISP=PASS


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Fri Sep 03, 2010 8:06 pm
Reply with quote

Hi,

I am having a query regarding the DISP=PASS for a temp file and a gdg file while trying to update it in the same step like below:

//IN1 DD DSN=&&TEMPCNTL,DISP=SHR

//OUT1 DD DSN=&&TEMPCNTL,DISP=(OLD,PASS)

This one doesnt work...

Again,

//IN1 DD DSN=TAY.AYA4AA.CONTROL.TEMP(+1),DISP=SHR

//OUT1 DD DSN=TAY.AYA4AA.CONTROL.TEMP(+1),
DISP=(OLD,PASS)

But this one works...

Now what I used to know regarding PASS is that, dataset passed to a subsequent step can be used only once in that step...but that is not explaining my second instance icon_sad.gif

Another thing if the same can be achieved using tempfile only (like reading and updating it in the same step) then how it can be done??
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Fri Sep 03, 2010 8:47 pm
Reply with quote

From the JCL User's Guide (manuals link at the top of the page), with emphasis added by me:
Quote:
4.6.2.1.5 Passing a Data Set

If more than one step in a job needs the same data set, each DD statement for the data set can pass it to a later step. A data set can be passed only within a job. A data set cannot be passed and received within the same step.
Whatever you are attempting to do, be aware that the IBM manual specifically states you cannot do it. Proceed further at your own (and your data) risk.
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: Fri Sep 03, 2010 11:39 pm
Reply with quote

Hello,

If you are lucky these attempts will fail. . . Worse is when they run and corrupt data and it is not detected until much, much later and multiple sets of production data are damaged. . .

If you explain what the process does, someone may have a suggestion for a different approach.
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Sat Sep 04, 2010 10:14 am
Reply with quote

Hi,

Thanks for the clarification and heads up...im going to use the following only but was just playing around with OLD, PASS parameter..

//IN1 DD DSN=TAY.AYA4AA.CONTROL.TEMP(+1),DISP=SHR
//IN2 DD DSN=TAY.AY4AA.ADD.FILE,DISP=SHR


//OUT1 DD DSN=TAY.AYA4AA.CONTROL.TEMP(+1),
DISP=(OLD,CATLG,DELETE)
//OUT2 DD DSN=TAY.AY4AA.ADD.DISCARD,DISP=NEW....DCB.. etc

My process in that step would be

IN1 - A control card file which has numeric 6 digit agent codes
IN2 - Add file which needs to be matched against IN1 and unique codes from it will be updated in the same control card file.
OUT1 - Updated IN1
OUT2 - unmatched records from IN2.

This matching is done by SYNCTOOL

Now, I dont want to use a seperate file in OUT1 as that would again be passed to the next step which does a deletion from that file just reverse like above. So I want to update (Add/Delete) in the same file otherwise 2 more REPRO steps needs to be added which i want to avoid.

Was just trying to play around with a TEMP file instead of a CATLGed file when i observed the OLD,PASS thing! Thanks for your help.
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: Sat Sep 04, 2010 1:42 pm
Reply with quote

Hello,

There is no good reason to try and re-use the file from IN1 as OUT1.

Hopefully, someone involved with promoting this from test to productoin will refuse to promote it. This has nothing to do with disp - it is just not acceptable on well-managed systems.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Binary File format getting change whi... All Other Mainframe Topics 5
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
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
Search our Forums:

Back to Top