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
 

 

To delete only few records from flat file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: To delete only few records from flat file
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

Moderator


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

PostPosted: Thu Nov 29, 2012 12:46 pm    Post subject:
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    Post subject: Reply to: To delete only few records from flat file
Reply with quote

Could you please give the syntax for it.

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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Thu Nov 29, 2012 12:57 pm    Post subject: Reply to: To delete only few records from flat file
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

Moderator


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

PostPosted: Thu Nov 29, 2012 1:02 pm    Post subject:
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: 1714
Location: UK

PostPosted: Thu Nov 29, 2012 4:51 pm    Post subject:
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

Active Member


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

PostPosted: Thu Nov 29, 2012 6:36 pm    Post subject:
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

Site Director


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

PostPosted: Thu Nov 29, 2012 9:50 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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