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: 8154
Location: East Dubuque, Illinois, 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 File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 1 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts it is possible output a SET value fro... Martylin JCL & VSAM 5 Fri Sep 22, 2017 7:08 am
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm

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