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
 

 

DFSort: how to delete 95th record out of 100 records

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

New User


Joined: 06 Mar 2006
Posts: 50
Location: PUNE

PostPosted: Fri Sep 28, 2007 2:28 pm    Post subject: DFSort: how to delete 95th record out of 100 records
Reply with quote

Hi ,

Using DFSORT how to delete 95th record, if file having 100 records.

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

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Fri Sep 28, 2007 2:43 pm    Post subject:
Reply with quote

Anand,

Code:
//STEP1     EXEC PGM=ICETOOL                               
//TOOLMSG DD SYSOUT=*                                     
//DFSMSG DD SYSOUT=*                                       
//INFILE DD DSN=I/P FILE ........                   
//TEMPFILE DD DSN=&&TEMP,DISP=(MOD,PASS)                   
//OUTFILE DD DSN=O/P FILE ....
//TOOLIN DD *                                             
  COPY FROM(INFILE) TO(TEMPFILE) USING(CTL1)               
  COPY FROM(TEMPFILE) TO(OUTFILE) USING(CTL2)             
/*                                                         
//CTL1CNTL DD *                                           
* change 81 to your (lrecl+1) below
  INREC OVERLAY=(81:SEQNUM,8,ZD)                           
/*                                                         
//CTL2CNTL DD *                   
* change 81 to your (lrecl+1) below
  OMIT COND=(81,8,ZD,EQ,+95)                               
*change 80 below  to your lrecl
  OUTREC BUILD=(1,80)                     
/*                                       


IP file lrecl assumed is 80. Change as per your file lrecl.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Sep 28, 2007 5:33 pm    Post subject:
Reply with quote

Anand78
Use this single pass DFSORT job to exclude the 95th record.
Code:
//*******************************************************               
//STEP1    EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD I/P FILE                                                 
/*                                                                     
//SORTOUT   DD O/P FILE                                                 
//SYSIN    DD *                                                         
  SORT FIELDS=COPY                                             
  INREC OVERLAY=(81:SEQNUM,8,ZD)                               
  OUTFIL  OMIT=(81,8,ZD,EQ,95),                                         
      BUILD=(1,80)                                                   
/*                                                                     
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Aug 15, 2008 12:32 am    Post subject:
Reply with quote

With z/OS DFSORT V1R5 PTF UK90013 (July, 2008) you can use DFSORT's new SUBSET operator to do this kind of thing quite easily like this:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//OUT DD DSN=...  output file
//TOOLIN DD *
SUBSET FROM(IN) TO(OUT) REMOVE INPUT RRN(95)
/*


For complete details on the new SUBSET function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
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 Record Not found in AlX but record re... mukun264 COBOL Programming 0 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am


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