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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: File contains 1000 records.i want to delete first 500 Record
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    Post subject:
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    Post subject:
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    Post subject: Re: File contains 1000 records.i want to delete first 500 Re
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: 464

PostPosted: Tue Aug 23, 2005 3:36 pm    Post subject: Re: File contains 1000 records.i want to delete first 500 Re
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    Post subject:
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    Post subject: delete the last 500 rec of the file
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    Post subject: Re: File contains 1000 records.i want to delete first 500 Re
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 Moderator


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

PostPosted: Fri Nov 25, 2005 8:32 pm    Post subject:
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    Post subject: Re: File contains 1000 records.i want to delete first 500 Re
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    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 Extra character appears in file when ... Balu5491 All Other Mainframe Topics 0 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm


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