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

Eliminate 1 or 2 particular record(s) from a flat file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
DEBALINA GHATAK

New User


Joined: 04 Dec 2006
Posts: 4
Location: India

PostPosted: Mon Dec 04, 2006 3:08 pm
Reply with quote

Hi All,

I would greet everyone if anybody can help me giving a solution to the problem given below.

The requirement is to eliminate one or more than one particular record(s) i.e. the whole row, from a single flat file.

For example, the file contains the records are

01SK0Zhkgkg987998kj
02SG0Vuiy68768970-9
03SF0Quguighuoho908kjbhklj
04SD0Ai8768934klnm


The o/p file will not contain the SK0Z and SD0A (these are the record identifiers from 3rd byte thru 6th byte) records and rest of the records will be resequenced, i.e. the o/p file will contain

01SG0Vuiy68768970-9
02SF0Quguighuoho908kjbhklj


Here we can assume that these two records SK0Z and SD0A will not be repeated.

Thanks
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Dec 04, 2006 3:24 pm
Reply with quote

Use sort and its omit function.
Back to top
View user's profile Send private message
justaprogrammer

New User


Joined: 30 Nov 2006
Posts: 1
Location: Zeroland

PostPosted: Mon Dec 04, 2006 3:35 pm
Reply with quote

Are 01 & 02 part of the records present in the file?
Back to top
View user's profile Send private message
DEBALINA GHATAK

New User


Joined: 04 Dec 2006
Posts: 4
Location: India

PostPosted: Mon Dec 04, 2006 3:46 pm
Reply with quote

Thanks Williams ... I will try this out. But will this resequence my output?
I mean will the serial numbers go out of sequence ?
Back to top
View user's profile Send private message
DEBALINA GHATAK

New User


Joined: 04 Dec 2006
Posts: 4
Location: India

PostPosted: Mon Dec 04, 2006 3:48 pm
Reply with quote

justaprogrammer wrote:
Are 01 & 02 part of the records present in the file?



Yep.. Serial number comprise the first two bytes of the record length.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Dec 04, 2006 3:55 pm
Reply with quote

justaprogrammer was concerned that your expected output did not exactally match your sample input.... icon_rolleyes.gif

Quote:
But will this resequence my output?


If you provide sort fields, yes, but if you specify COPY, no.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Mon Dec 04, 2006 4:00 pm
Reply with quote

Hi Debalina,

Give this as sort card

Code:

  SORT FIELDS=COPY                                 
  OMIT COND=(3,4,CH,EQ,C'SK0Z',OR,3,4,CH,EQ,C'SD0A')
  OUTFIL OUTREC=(SEQNUM,2,ZD,3,78)


Hope it will helpful
Back to top
View user's profile Send private message
DEBALINA GHATAK

New User


Joined: 04 Dec 2006
Posts: 4
Location: India

PostPosted: Mon Dec 04, 2006 5:49 pm
Reply with quote

Hi Ekta,

Thanks a lot. It worked successfully.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Mon Dec 04, 2006 5:53 pm
Reply with quote

Hi There,

Glad I could help.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Dec 04, 2006 5:56 pm
Reply with quote

guptae wrote:
Code:

  SORT FIELDS=COPY                                 
  OMIT COND=(3,4,CH,EQ,C'SK0Z',OR,3,4,CH,EQ,C'SD0A')
  OUTFIL OUTREC=(SEQNUM,2,ZD,3,78)


Why "SEQNUM"?
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Mon Dec 04, 2006 6:00 pm
Reply with quote

Hi William,

I put SEQNUM because debalina wants the record count (serial number ) as first two byte.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Dec 04, 2006 6:34 pm
Reply with quote

guptae wrote:
I put SEQNUM because debalina wants the record count (serial number ) as first two byte.

I'm sorry, but I still don't see where that requirement was made, could you please point it out to me? It's probably my male vision blinding me...grin....

(male vision: the ability to not see the obvious) icon_lol.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Mon Dec 04, 2006 10:48 pm
Reply with quote

William,

The input is:

Code:

01SK0Zhkgkg987998kj
02SG0Vuiy68768970-9
03SF0Quguighuoho908kjbhklj
04SD0Ai8768934klnm


The expected output is:

Code:

01SG0Vuiy68768970-9
02SF0Quguighuoho908kjbhklj


Note that in the input the SK0Z record has 01, the SG0V record has 02, the SF0Q record has 03 and the SD0A record has 04, whereas in the output the SG0V record has 01 and the SF0Q record has 02. Records have been omitted and the remaining records have been resequenced. So SEQNUM is needed on the OUTFIL statement or OUTREC statement to get the new sequence numbers.

I'd suggest that you actually test your "solutions" and compare your output to the stated output before you post. Throwing out "solutions" without verifying that they work just confuses people.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Dec 04, 2006 11:29 pm
Reply with quote

icon_redface.gif You are right Frank, I really shouldn't post before my second cup of coffee icon_redface.gif I missed that sequence reference totally icon_redface.gif
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
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
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top