View previous topic :: View next topic
|
Author |
Message |
selvakumar_ms
New User
Joined: 30 Mar 2004 Posts: 8
|
|
|
|
hi,
A vsam file contains 1000 records.i want to delete first 500 records.how do i delete it? |
|
Back to top |
|
|
bluebird
Active User
Joined: 03 Feb 2004 Posts: 127
|
|
|
|
hello,
you could try idcams reprop command :
Code: |
//step0 exec pgm=idcams
//sysprint DD sysout=*
//outfile dd disp=shr,dsn=your-dsn
//sysin DD *
repro filein(outfile) fileout(outfile) skip(500)
|
check in the idcams manual for exact repro command or type on any ISPF panel :
TSO HELP REPRO
or icetool utility may do the same (see in icetool manual)
hope it helps |
|
Back to top |
|
|
vikas4u
New User
Joined: 12 Aug 2004 Posts: 14 Location: bangalore
|
|
|
|
if u want to delete first 500 records then use count(500) option.
skip will automatically take the starting value.
if u want to delete last 500 records then use
skip(500)
if u want to delete any particular sequence of records .. suppose from 501 to 600 then use skip(500) count(100)
hope this will clear ur doubts |
|
Back to top |
|
|
atik
New User
Joined: 29 Jul 2005 Posts: 20
|
|
|
|
If you give SKIP(n), then this will delete first n records and if COUNT(n) is given then this will retain n records from first and delete all other records. Please correct me if I am wrong. |
|
Back to top |
|
|
Rupesh.Kothari
Member of the Month
Joined: 27 Apr 2005 Posts: 463
|
|
|
|
Hi
Try this code. this code will delete first 500 records from your input file.
Code: |
//STEP01 EXEC PGM=SORT
//SORTIN DD DSN=Inputfile,DISP=SHR
//SORTOUT DD DSN=Outputfile,all parameters
//SYSIN DD *
SORT FIELDS=COPY,
SKIPREC=500
/*
//SYSOUT DD SYSOUT=*
|
Regards
Rupesh |
|
Back to top |
|
|
Hames
New User
Joined: 03 Oct 2005 Posts: 49
|
|
|
|
Hi Vikas,
Quote: |
if u want to delete first 500 records then use count(500) option.
skip will automatically take the starting value.
if u want to delete last 500 records then use
skip(500)
if u want to delete any particular sequence of records .. suppose from 501 to 600 then use skip(500) count(100) |
This is not correct. Its just the opposite.
SKIP(500) will skip the first 500 records (i.e deleted, will not be printed on the output file). Remaining records will be printed.
COUNT(500) will print only the first 500 records and remaining will be deleted.
If you use both SKIP(500) and COUNT(500) then first 500 records will be skipped and next 500 records will be printed remaining records will be skipped |
|
Back to top |
|
|
bnsahoo
New User
Joined: 06 Jun 2005 Posts: 18 Location: mumbai,india
|
|
|
|
Then,How can we delete the last 500 rec of the file? |
|
Back to top |
|
|
Alain Benveniste
New User
Joined: 14 Feb 2005 Posts: 88
|
|
|
|
bnsahoo,
Here is the way to do that.
Code: |
//STEP0001 EXEC PGM=ICETOOL
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//IN DD DSN=your file,DISP=SHR
//TOOLIN DD *
COPY FROM(IN) TO(ICE1CNTL) USING(ICE0)
COPY FROM(IN) TO(OUTX) USING(ICE1)
/*
//OUTX DD SYSOUT=*
//ICE0CNTL DD *
OUTFIL FNAMES=ICE1CNTL,OUTREC=(80X),
TRAILER1=(' OPTION STOPAFT=',COUNT-500=(M11,LENGTH=5)),
REMOVECC,NODETAIL
/*
//ICE1CNTL DD DSN=&&OUT,
// DISP=(NEW,DELETE,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(1,0),RLSE)
|
Alain |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
NewPower,
I've deleted your post since it was unrelated to the topic of this thread.
Please start a new thread for your new topic. And please explain more clearly what it is you want to do. |
|
Back to top |
|
|
vinodmaanju
New User
Joined: 10 May 2005 Posts: 28 Location: Pune
|
|
|
|
Hi,
This code will not copy first 500 records in output file from your input file.
Code: |
//STEP1 EXEC PGM=IDCAMS
//DDIN01 DD DSN=INPUT FILE NAME
//DDOUT01 DD DSN=OUTPUT FILE NAME
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REPRO -
INFILE(DDIN01) -
OUTFILE(DDOUT01) -
SKIP(500) - << THIS OPTION WILL SKIP YOUR FIRST
<< 500 RECORDS IN OUTPUT FILE AND
<< START COPYING FROM 501 RECORDS
COUNT(500)
/*
//
|
|
|
Back to top |
|
|
|