Query regrding SORT FIELDS



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Query regrding SORT FIELDS

Postby kumarbh » Fri Jan 30, 2009 10:28 pm

hi friends
i had a few questions:
Q1.If I have an input file in which i have 1000 observations and I write the following code in the sort card
SORT FIELDS=COPY,STOPAFT=100

then i want to know will it simply copy the first 100 observations in my output file or will it also sort each observation and then copy the first 100 sorted observations or something else.

Q2.and also please tell me what the following code will do

SORT FIELDS=(1,10,CH,A),STOPAFT=100


in this case will it sort the 1st 10 characters of all the 1000 observations and then copy the first 100 sorted obs or will it copy the top 100 obs and then sort the 1st 10 characters of these 100 observations.

Thanks in advance to anyone who helps me in understanding these.
kumarbh
 
Posts: 1
Joined: Fri Jan 30, 2009 3:56 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Query regrding SORT FIELDS

Postby Frank Yaeger » Fri Jan 30, 2009 11:14 pm

STOPAFT=n stops after n input records have been accepted. So it will copy the first 100 input records and then copy (case 1) or sort (case 2) them.

SORT FIELDS=COPY does a Copy, not a Sort.

SORT FIELDS=(1,10,CH,A) does a Sort.

I would think you could have easily tried this yourself to see what happens in each case. Don't be afraid to experiment.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post