Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1542
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: 7314

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: 1542
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: 1922
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: 967
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 VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm
No new posts Matching and unmatched records!! Vignesh Sid SYNCSORT 3 Thu Nov 09, 2017 11:22 am
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm
No new posts Updating data from one file to other!!! Vignesh Sid SYNCSORT 1 Mon Nov 06, 2017 2:42 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us