Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Creating sample test file from Source data file using DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 176
Location: Pune, Maharashtra, India

PostPosted: Mon Oct 08, 2012 5:16 pm    Post subject: Creating sample test file from Source data file using DFSORT
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Oct 08, 2012 5:28 pm    Post subject: Reply to: Creating sample test file from Source data file us
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: 176
Location: Pune, Maharashtra, India

PostPosted: Mon Oct 08, 2012 5:37 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Oct 08, 2012 6:02 pm    Post subject: Reply to: Creating sample test file from Source data file us
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: 176
Location: Pune, Maharashtra, India

PostPosted: Mon Oct 08, 2012 6:08 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Oct 08, 2012 6:10 pm    Post subject: Reply to: Creating sample test file from Source data file us
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: 269
Location: Mumbai

PostPosted: Mon Oct 08, 2012 6:12 pm    Post subject:
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: 176
Location: Pune, Maharashtra, India

PostPosted: Mon Oct 08, 2012 6:16 pm    Post subject:
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    Post subject:
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: 176
Location: Pune, Maharashtra, India

PostPosted: Tue Oct 09, 2012 11:46 pm    Post subject: Reply to: Creating sample test file from Source data file us
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: 176
Location: Pune, Maharashtra, India

PostPosted: Tue Oct 09, 2012 11:47 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 1 Tue Dec 06, 2016 4:38 am
No new posts How to move a long alphanumeric data ... lind sh COBOL Programming 5 Mon Dec 05, 2016 7:51 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us