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
 

 

Help needed on DISP

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
vicharapusrinu
Warnings : 1

New User


Joined: 04 Dec 2006
Posts: 63
Location: Hyderabad

PostPosted: Tue Jan 14, 2014 4:42 pm    Post subject: Help needed on DISP
Reply with quote

Hi,

would you please help me out please.

by making use use of SORT, I am planning to edit data set, here in my case both input and output data sets are same,(Here I am reading a field-1 and if it satisfy that condition I am changing field-2 of same file )

Here my question is what is DISP i have to give to SORTIN and SORTOUT?

Regards,
Srini
Back to top
View user's profile Send private message

steve-myers

Active User


Joined: 30 Nov 2013
Posts: 461
Location: The Universe

PostPosted: Tue Jan 14, 2014 5:01 pm    Post subject:
Reply with quote

  • It is usually a bad idea to specify the same data set for the SORTIN and SORTOUT data sets.
  • JCL like this is sort of safe.
    Code:
    //A       EXEC PGM=IEBGENER
    //SYSPRINT DD  SYSOUT=*
    //SYSUT1   DD  DISP=SHR,DSN=...
    //SYSUT2   DD  DISP=(NEW,PASS),UNIT=SYSDA,...
    //SYSIN    DD  DUMMY
    //B       EXEC PGM=SORT
    //SYSOUT   DD  SYSOUT=*
    //SORTIN   DD  DISP=(OLD,PASS),DSN=*.A.SYSUT2
    //SORTOUT  DD  DISP=(OLD,PASS),VOL=REF=*.SORTIN,
    //             DSN=*.A.SYSUT2
    //SYSIN    DD  *
     ...
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: Tue Jan 14, 2014 7:56 pm    Post subject:
Reply with quote

Hello,

In most organizations, it is not acceptable to use the input file as output.

Change your process to create a new file. Then do whatever is needed to have the proper DSN(s) - i.e rename.
Back to top
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Wed Jan 15, 2014 10:35 am    Post subject:
Reply with quote

As Mr. Steve & Mr. Dick mentioned, Its really a bad idea to use same data set for SORTIN & SORTOUT.

But if you have no choice then, this might help you.

Code:

//STEP0001 EXEC PGM=SORT                                     
//SORTIN   DD DSN=Your DSN here,DISP=OLD             
//SORTOUT  DD DSN=Your DSN here,DISP=(OLD,CATLG,KEEP)
//SYSOUT   DD SYSOUT=*                                       
//SYSIN    DD *                                             
  SORT FIELDS=COPY
----Your condtion here----                                         
//
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1713
Location: UK

PostPosted: Wed Jan 15, 2014 2:25 pm    Post subject: Reply to: Help needed on DISP
Reply with quote

If you are using DISP=OLD to read then dataset it is already cataloged so why have it on the output disposition? Also, OLD implies KEEP.
Back to top
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Wed Jan 15, 2014 2:29 pm    Post subject:
Reply with quote

I meant to make sure it won't get deleted when something goes wrong in that step.

I guess, it won't harm anything. am I wrong?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Wed Jan 15, 2014 3:16 pm    Post subject: Reply to: Help needed on DISP
Reply with quote

sureshpathi10,

It doesn't matter if it gets deleted when something goes wrong as it has already been corrupted. In your case, with COPY, the dataset is open for both input and output simultaneously, which is clearly and irrevocably bad. In the case of a SORT failing in the output stage, the input has already been destroyed, as it is the input dataset, now open for output.

vicharapusrinu,

This is an altogether bad idea. You would need to take a backup of your input dataset before doing the SORT, so that you have somewhere to recover to if something goes wrong. So, it is as simple to write your output to a different dataset, as has already been suggested several times.
Back to top
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Wed Jan 15, 2014 3:21 pm    Post subject:
Reply with quote

Thanks Bill... That cleared me up. who would want messed up file anyway icon_lol.gif
Back to top
View user's profile Send private message
vicharapusrinu
Warnings : 1

New User


Joined: 04 Dec 2006
Posts: 63
Location: Hyderabad

PostPosted: Thu Jan 16, 2014 1:25 pm    Post subject: Reply to: Help needed on DISP
Reply with quote

Thanks a lot for all of you, for your suggestions !!!!!!!!

Regards,
Srini
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: Thu Jan 16, 2014 9:52 pm    Post subject:
Reply with quote

You're welcome - so how are you going to implement?

d
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 Help Needed with View Direct shailesh_do CA Products 2 Wed Jul 13, 2016 10:39 am
No new posts DISP=(SHR,PASS) performance opinion steve-myers JCL & VSAM 1 Wed Dec 02, 2015 11:53 pm
No new posts Information needed on using the COBAN... venugopal.dondla COBOL Programming 5 Thu Oct 08, 2015 3:34 pm
No new posts Help needed in Conditional statement ... vinu78 DB2 5 Tue Sep 15, 2015 10:14 am
No new posts Question about DISP=MOD harifsheik JCL & VSAM 3 Tue Jun 16, 2015 2:39 pm


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