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

Sort a dataset without having to produce another dataset


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

New User


Joined: 05 Sep 2006
Posts: 30
Location: Philippines

PostPosted: Fri Mar 02, 2007 2:44 pm
Reply with quote

I just want to ask: is there a way to sort a dataset without having to produce another dataset? if there is, what jcl utility it would be?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Fri Mar 02, 2007 2:46 pm
Reply with quote

For any of the common SORT utilities (DFSORT, SYNCSORT etc.) you can specify the same file in SORTIN and in SORTOUT.

O.
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 Mar 02, 2007 10:56 pm
Reply with quote

Hello,

If the sort ever abends, what will you do to re-create the input thas been destroyed?
Back to top
View user's profile Send private message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Sat Mar 03, 2007 4:35 pm
Reply with quote

hallecodec,
U can specify the same dataset name in u r SORTIN and SORTOUT dd st. Yes as Dick mentioned if u r JCL abends u would be loosin all the data, usually this way of sorting is done only when u have a back up of the ds in a GDG base. We have a prog. generating a file with data, the next step of mine is to take back up of the same to GDG , and the third step sorts the file and gives the output on the same file,


Thamilzan.
Back to top
View user's profile Send private message
kregen

New User


Joined: 16 Mar 2006
Posts: 21

PostPosted: Mon Mar 05, 2007 5:39 pm
Reply with quote

Hi,
ich do it as follwed

//SORT EXEC=DFSORT
.
.
.
.
.
//SORTIN DD DISP=(OLD,DELETE,KEEP),DSN=GDG.ENTRY(0)
//SORTOUT DD DISP=(NEW,CATLG),DSN=GDG.ENTRY(+1)
.
.
.
THE GDG-Base ist defined with LIMIT 1 SCRATCH.
TSO DEFINE GDG ( NAME(GDG.ENTRY) LIMIT(1)

All followed JOBSTEPS are running with GDG-BASE-Name only

//READIT EXEC=PROG
//INPUT DD DISP=SHR,DSN=GDG.ENTRY
.
.
.
cu
kai
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: Mon Mar 05, 2007 8:39 pm
Reply with quote

Hello Kregen,

Neat solution icon_smile.gif

It solves the problem of still having the input in case of an abend as well as producing the "same" dsn as output. While it does create a "new" file, two files exist only briefly and when the step is done, the downstream processes see only "the file".
Back to top
View user's profile Send private message
hallecodec

New User


Joined: 05 Sep 2006
Posts: 30
Location: Philippines

PostPosted: Tue Mar 06, 2007 12:53 pm
Reply with quote

hi,

thanks for all of your helpful tips and suggestions...
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
Search our Forums:

Back to Top