View previous topic :: View next topic
|
Author |
Message |
rohanthengal
Active User
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
I have a source data file having around 20000 recorrds and need to create some test file with extracted records from the same source file.
So, i want to populate 1st, 5th, 10th ,15th record and so on.... upto 1000..!
Can we use any option from DFSORT utility to create such test file ? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
Can we use any option from DFSORT utility to create such test file ? |
yes |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
Can we use any option from DFSORT utility to create such test file ? |
Yes.
P.S.
If You do not like Yes/No answers, do not ask Yes/No questions |
|
Back to top |
|
|
rohanthengal
Active User
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
Thanks,
Please let me know the option to be used to create sampled test file. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
sampled or better sample is the buzzword
the sequence is mathematically <illogic> the delta is not the same
out of the box dfsort will sample 1,6,11,16,21,... |
|
Back to top |
|
|
rohanthengal
Active User
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
Yes Enrico,
a logical error .. my bad...
It should be with constant delta like you said...
1,6,11,16,21 and so on.. till some limit like 100 or any constant
Thanks. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
search the forum for the link to the paper "smart sort tricks"
and obviously the dfsort manuals |
|
Back to top |
|
|
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
Hi,
Check for the sort keyword SAMPLE in manual..
USe SAMPLE along with ENDREC, It will solve your purpose
Thanks,
Chandan |
|
Back to top |
|
|
rohanthengal
Active User
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
Partners, thanks for your valuable pointers, I will try and let you know for sure. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
----+----1----+----2----+----3----+----4----+----5----+----6----+
11111 RECORD 01
11111 RECORD 02
11111 RECORD 03
11111 RECORD 04
11111 RECORD 05
11111 RECORD 06
11111 RECORD 07
11111 RECORD 08
11111 RECORD 09
11111 RECORD 10
11111 RECORD 11
11111 RECORD 12
11111 RECORD 13
11111 RECORD 14
11111 RECORD 15
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFOUTLEN=80,
IFTHEN=(WHEN=GROUP,RECORDS=5,PUSH=(81:SEQ=1)),
IFTHEN=(WHEN=(81,1,ZD,EQ,1),OVERLAY=(15:C'MODIFIED RECORD'))
//* |
The output from the above job is
Code: |
11111 MODIFIED RECORD
11111 RECORD 02
11111 RECORD 03
11111 RECORD 04
11111 RECORD 05
11111 MODIFIED RECORD
11111 RECORD 07
11111 RECORD 08
11111 RECORD 09
11111 RECORD 10
11111 MODIFIED RECORD
11111 RECORD 12
11111 RECORD 13
11111 RECORD 14
11111 RECORD 15 |
|
|
Back to top |
|
|
rohanthengal
Active User
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
Yes, it worked out for SAMPLED file creation
Control card of job step with program SORT, will work as:
Code: |
OPTION COPY
OUTFIL FNAMES=OUT1,STRARTREC=1,SAMPLE=5,ENDREC=50
OUT1 will include now record #1,6,11,16,21,26,31,36,41,46 from SORTIN file.. |
|
|
Back to top |
|
|
rohanthengal
Active User
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
SAMPLE option provides us interval... Its really great to use, very easy |
|
Back to top |
|
|
|