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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Eliminate 1 or 2 particular record(s) from a flat file
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: 3158
Location: Tucson AZ

PostPosted: Mon Dec 04, 2006 3:24 pm    Post subject:
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    Post subject: Re: Eliminate 1 or 2 particular record(s) from a flat file
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    Post subject: Re: Eliminate 1 or 2 particular record(s) from a flat file
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    Post subject: Re: Eliminate 1 or 2 particular record(s) from a flat file
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: 3158
Location: Tucson AZ

PostPosted: Mon Dec 04, 2006 3:55 pm    Post subject:
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: 1187
Location: Bangalore,India

PostPosted: Mon Dec 04, 2006 4:00 pm    Post subject:
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    Post subject:
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: 1187
Location: Bangalore,India

PostPosted: Mon Dec 04, 2006 5:53 pm    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Dec 04, 2006 5:56 pm    Post subject:
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: 1187
Location: Bangalore,India

PostPosted: Mon Dec 04, 2006 6:00 pm    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Dec 04, 2006 6:34 pm    Post subject:
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 Moderator


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

PostPosted: Mon Dec 04, 2006 10:48 pm    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Dec 04, 2006 11:29 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
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 File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 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
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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