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

Creating sample test file from Source data file using DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 206
Location: Globe, India

PostPosted: Mon Oct 08, 2012 5:16 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Oct 08, 2012 5:26 pm
Reply with quote

Quote:
Can we use any option from DFSORT utility to create such test file ?

yes
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Oct 08, 2012 5:28 pm
Reply with quote

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 icon_cool.gif
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 206
Location: Globe, India

PostPosted: Mon Oct 08, 2012 5:37 pm
Reply with quote

icon_smile.gif Thanks,
Please let me know the option to be used to create sampled test file.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Oct 08, 2012 6:02 pm
Reply with quote

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
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 206
Location: Globe, India

PostPosted: Mon Oct 08, 2012 6:08 pm
Reply with quote

Yes Enrico,
a logical error .. my bad... icon_sad.gif

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Oct 08, 2012 6:10 pm
Reply with quote

search the forum for the link to the paper "smart sort tricks"
and obviously the dfsort manuals
Back to top
View user's profile Send private message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 275
Location: Mumbai

PostPosted: Mon Oct 08, 2012 6:12 pm
Reply with quote

Hi,

Check for the sort keyword SAMPLE in manual..

USe SAMPLE along with ENDREC, It will solve your purpose

Thanks,
Chandan
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 206
Location: Globe, India

PostPosted: Mon Oct 08, 2012 6:16 pm
Reply with quote

Partners, thanks for your valuable pointers, I will try and let you know for sure.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Oct 08, 2012 11:51 pm
Reply with quote

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
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 206
Location: Globe, India

PostPosted: Tue Oct 09, 2012 11:46 pm
Reply with quote

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
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 206
Location: Globe, India

PostPosted: Tue Oct 09, 2012 11:47 pm
Reply with quote

SAMPLE option provides us interval... Its really great to use, very easy
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 1
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top