Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Reading and updating same file in same step with DISP=PASS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Reading and updating same file in same step with DISP=PASS
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: 8201
Location: Dubuque, Iowa, USA

PostPosted: Fri Sep 03, 2010 8:47 pm    Post subject:
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

Site Director


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

PostPosted: Fri Sep 03, 2010 11:39 pm    Post subject:
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    Post subject: Reply to: Reading and updating same file in same step with D
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

Site Director


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

PostPosted: Sat Sep 04, 2010 1:42 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us