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

File contains 1000 records.i want to delete first 500 Record


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
selvakumar_ms

New User


Joined: 30 Mar 2004
Posts: 8

PostPosted: Sat Apr 10, 2004 6:19 pm
Reply with quote

hi,
A vsam file contains 1000 records.i want to delete first 500 records.how do i delete it?
Back to top
View user's profile Send private message
bluebird

Active User


Joined: 03 Feb 2004
Posts: 127

PostPosted: Sat Apr 10, 2004 7:15 pm
Reply with quote

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
View user's profile Send private message
vikas4u

New User


Joined: 12 Aug 2004
Posts: 14
Location: bangalore

PostPosted: Sat Sep 25, 2004 11:34 am
Reply with 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)

hope this will clear ur doubts
Back to top
View user's profile Send private message
atik

New User


Joined: 29 Jul 2005
Posts: 20

PostPosted: Tue Aug 23, 2005 3:18 pm
Reply with quote

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
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 463

PostPosted: Tue Aug 23, 2005 3:36 pm
Reply with quote

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
View user's profile Send private message
Hames

New User


Joined: 03 Oct 2005
Posts: 49

PostPosted: Thu Nov 24, 2005 10:21 am
Reply with quote

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
View user's profile Send private message
bnsahoo

New User


Joined: 06 Jun 2005
Posts: 18
Location: mumbai,india

PostPosted: Thu Nov 24, 2005 10:46 am
Reply with quote

Then,How can we delete the last 500 rec of the file?
Back to top
View user's profile Send private message
Alain Benveniste

New User


Joined: 14 Feb 2005
Posts: 88

PostPosted: Fri Nov 25, 2005 12:15 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Fri Nov 25, 2005 8:32 pm
Reply with quote

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
View user's profile Send private message
vinodmaanju

New User


Joined: 10 May 2005
Posts: 28
Location: Pune

PostPosted: Sun Dec 04, 2005 1:19 pm
Reply with quote

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
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 FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top