|
|
| Author |
Message |
Anand78
New User
Joined: 06 Mar 2006 Posts: 48 Location: PUNE
|
|
|
|
Hi ,
Using DFSORT how to delete 95th record, if file having 100 records.
Thanks,
Anand |
|
| Back to top |
|
 |
References
|
|
 |
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1478 Location: Bangalore,India
|
|
|
|
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 |
|
 |
krisprems
Senior Member
Joined: 27 Nov 2006 Posts: 624 Location: India
|
|
|
|
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 |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4577 Location: San Jose, CA
|
|
|
|
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 |
|
 |
|
|
|