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
 

 

Searching a perticular field in a record.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Searching a perticular field in a record.
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: 3158
Location: Tucson AZ

PostPosted: Sun May 06, 2007 1:19 am    Post subject:
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 Moderator


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

PostPosted: Sun May 06, 2007 9:00 pm    Post subject:
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    Post subject: Searching a perticular field in a record
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

Site Director


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

PostPosted: Mon May 07, 2007 1:53 am    Post subject:
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    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 Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am


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