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

Searching a perticular field in a record.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
adarsh.bhalke

New User


Joined: 06 May 2007
Posts: 16
Location: pune

PostPosted: Sun May 06, 2007 1:09 am
Reply with quote

Hi all,
I have one file which contains lets say 100 records. the structure of the record is
F1E1asfhsdh123456789012dkkddkkdkdksskddks
F1E1dhsdkds456789012322dssdhksdskdsdsdskd
F1E1jsllsdldll123456789012skjkdkdhsdkkhskhdk
F2E2uhgjgjgj123456789012ssashkjsasaskskjasa

Here 123456789012 is one fileld lets say CBAID now i want to select all the records having this Key as a part and the Record type as F1E1.
After selecting these records i want to delete these records.

in above records i want to delete the records which are in bold because theay are of same type and having same CBAID

Can anyone send me the solution for this as soon as possible.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Sun May 06, 2007 1:19 am
Reply with quote

If your "key" is in the same location in all the records that you want to select, that is simple.
Omitting records might be a little more work, I don't understand how the selected records from your sample differ form the deleted records, do they?
Would more records in the example show that some selected records do not get deleted?
Would more records in the example show that some un-selected records do also get deleted?
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: Sun May 06, 2007 9:00 pm
Reply with quote

adarsh,

Based on your example, it appears that you want to delete records which have 'F1E1' in positions 1-4 and '123456789012' anywhere from position 5 to the end of the record. Here's a DFSORT job that will do that. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
F1E1asfhsdh123456789012dkkddkkdkdksskddks
F1E1dhsdkds456789012322dssdhksdskdsdsdskd
F1E1jsllsdldll123456789012skjkdkdhsdkkhskhdk
F2E2uhgjgjgj123456789012ssashkjsasaskskjasa
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  OMIT COND=(1,4,CH,EQ,C'F1E1',AND,
    5,76,SS,EQ,C'123456789012')
/*


If that's not what you want to do, then please explain in more detail what you want to do with a better example.
Back to top
View user's profile Send private message
adarsh.bhalke

New User


Joined: 06 May 2007
Posts: 16
Location: pune

PostPosted: Mon May 07, 2007 1:41 am
Reply with quote

Hello,
As my file is consist of thousands of records,in this case i want to search all F1E1 type of record which has duplicate CBA id (which is mentioned above)
which is a key to search. But here i cant Hard code CBA Id value as i may have thousands of duplicate records in a file.
That means first I have to search the entire file based on CBA id. If this CBA id found in 2 F1E1 type of records then delete those records or move them to different file.

I am waiting for your reply.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon May 07, 2007 1:53 am
Reply with quote

Hello,

If the duplicates might appear anywhere in the file and there multiple, unpredictable CBA Ids, you need to get the records into sequence for processing.

After you sort the file by CBA Id, you can remove the duplicates.
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top