View previous topic :: View next topic
|
Author |
Message |
kumar1234
New User
Joined: 06 Nov 2007 Posts: 84 Location: bangalore
|
|
|
|
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 |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Delete is equal to OMIT
So OMIT those records using SORT for the specific keys |
|
Back to top |
|
|
kumar1234
New User
Joined: 06 Nov 2007 Posts: 84 Location: bangalore
|
|
|
|
Could you please give the syntax for it.
Thanks. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
And NO, you should NOT try to write the output back over the original input data. . . |
|
Back to top |
|
|
|