Page 1 of 1

Query regrding SORT FIELDS

PostPosted: Fri Jan 30, 2009 10:28 pm
by kumarbh
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.

Re: Query regrding SORT FIELDS

PostPosted: Fri Jan 30, 2009 11:14 pm
by Frank Yaeger
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.