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

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


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 1436
Location: Bangalore,India

PostPosted: Fri Sep 28, 2007 2:43 pm
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
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 Developer


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

PostPosted: Fri Aug 15, 2008 12:32 am
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:

Use [URL] BBCode for External Links
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts DELETE SPUFI DB2 1
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top