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

To delete only few records from flat file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kumar1234

New User


Joined: 06 Nov 2007
Posts: 84
Location: bangalore

PostPosted: Thu Nov 29, 2012 12:35 pm
Reply with quote

Hi,

I have a flat file where I want delete only the 3rd and the 6th record. Could anyone please let me know the JCL which I nned to use to perform this task. I am not supposed to delete it manually. I need to delete based on the first 9 bytes key.

Below are the records'

Code:
100743251   001..@ræ   00000G20110322012332
102950443   001...ræ   00000G20111312012332
107491636   001..*ræ   00000G20113392012332
202026155   001..*ræ   00000G20120882012332
202141431   001..%ræ   00000G20120972012332
202414280   001..*ræ   00000G20121082012332
202730134   001..*ræ   00000G20121172012332


Thanks,
kumar

Code'd
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu Nov 29, 2012 12:46 pm
Reply with quote

Delete is equal to OMIT

So OMIT those records using SORT for the specific keys
Back to top
View user's profile Send private message
kumar1234

New User


Joined: 06 Nov 2007
Posts: 84
Location: bangalore

PostPosted: Thu Nov 29, 2012 12:54 pm
Reply with quote

Could you please give the syntax for it.

Thanks.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Nov 29, 2012 12:57 pm
Reply with quote

It seems to be a strange type of requirement. Is it for learning?

If you use OMIT/INCLUDE for your two key values, you can certainly get rid of the 3rd and 6th records, but bear in mind that anywhere else in the data that the same key exists will also be rermoved.

You could get rid of 3rd, and 6th, blindly, by generating a SEQNUM (sequence number) and using OUTFIL OMIT/INCLUDE.

To get rid of 3rd and 6th with particular keys, combine the two on OUTFIL OMIT/INCLUDE.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu Nov 29, 2012 1:02 pm
Reply with quote

INCLUDE COND includes the records and OMIT COND omits the records

I see your old posts and you have prior experince with INCLUDE COND

Can't you try this yourself?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Nov 29, 2012 4:51 pm
Reply with quote

Quote:
please let me know the JCL which I nned to use to perform this task

Use the standard Syncsort JCL as specified in the manual - modified to for your datset names.

If you mean syncsort control cards then say so.
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Thu Nov 29, 2012 6:36 pm
Reply with quote

I presume you know that you are actually deleting the records from a copy of the file - the input flat file will be untouched.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Nov 29, 2012 9:50 pm
Reply with quote

Hello,

And NO, you should NOT try to write the output back over the original input data. . .
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
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