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

Need to delete the record according to key field


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

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Mon Apr 30, 2007 3:47 pm
Reply with quote

pls go thr attachment..
Input file
Code:
000001 A1 Filename Comparision>>>>>>>>>>>>>>>>>>>>>>>> Filename Reference>>>>>>
..........................XXXXXXXXXXXX
000002 F1 E1 C 00000002 E108000070300000000002190051653710001000011108000070300
000003 F1 E2 C 00000003 E208000070300000000004190051653710000000000004001600000
000004 F1 E3 C 00000004 E308000070300000000005190051653710000000700000000000000
000005 F1 E4 C 00000005 E40800007030000000000319005165371 MM000000000000000 00
000006 F1 E4 C 00000006 E49800009070000000000719005165372 MM000000000000000                           
..........................XXXXXXXXXXXX
000007 V1 E1 DKK-ACCT-TYPE-CD        DI F 0052                                 
000008 V1 E1 DKK-ACCT-TYPE-CD        DI F 0052 00                             
000009 V1 E1 DKK-ACCT-TYPE-CD        DI F 0052                                 
000010 V1 E3 INF3-DSCNT-AMT          DI F 0036 +00000000000000                 
000011 V1 E3 INF3-DSCNT-AMT          DI F 0036                                 
000012 V1 E1 DKK-ACCT-TYPE-CD        DI F 0052 00                             
000013 V1 E1 DKK-ACCT-TYPE-CD        DI F 0052                                 
000014 F1 E2 R 00000033 E29000000036101235008002                            420
000015 F1 E2 R 00000034 E29000000036101235008002                            420
000016 V1 E3 INF3-DSCNT-AMT          DI F 0036 +00000000000000                 
000017 V1 E3 INF3-DSCNT-AMT          DI F 0036                                 
000018 F1 E3 R 00000036 E3900000003600000011000000000000000+000000000001708+570

Output File
Code:
000001 A1 Filename Comparision>>>>>>>>>>>>>>>>>>>>>>>> Filename Reference>>>>>>
..........................XXXXXXXXXXXX
000002 F1 E1 C 00000002 E108000070300000000002190051653710001000011108000070300
000003 F1 E4 C 00000006 E49800009070000000000719005165372 MM000000000000000                           
..........................XXXXXXXXXXXX
000004 V1 E1 DKK-ACCT-TYPE-CD        DI F 0052                                 
000005 V1 E1 DKK-ACCT-TYPE-CD        DI F 0052 00                             
000006 V1 E1 DKK-ACCT-TYPE-CD        DI F 0052                                 
000007 V1 E3 INF3-DSCNT-AMT          DI F 0036 +00000000000000                 
000008 V1 E3 INF3-DSCNT-AMT          DI F 0036                                 
000009 V1 E1 DKK-ACCT-TYPE-CD        DI F 0052 00                             
000010 V1 E1 DKK-ACCT-TYPE-CD        DI F 0052                                 
000011 F1 E2 R 00000033 E29000000036101235008002                            420
000012 F1 E2 R 00000034 E29000000036101235008002                            420
000013 V1 E3 INF3-DSCNT-AMT          DI F 0036 +00000000000000                 
000014 V1 E3 INF3-DSCNT-AMT          DI F 0036                                 
000015 F1 E3 R 00000036 E3900000003600000011000000000000000+000000000001708+570

In the above record,

From position 4-5,
?E1? is the main record of the individual customer
?E2?, ?E3?, ?E4?, ?E5?? is detail record of the customer corresponding to ?E1? key field

If main record of the customer present in the file,then no need of keeping the detail record.It has to delete.
Ex: If ?E1? present, ?E2?,?E3?,?E4? record has to be deleted.

If only detail record present,then it has to to be keep has it is?.
Ex: If ?E2?, ?E3?,, ?E4? is present without ?E1?,
It should not be deleted.
Thank you
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Apr 30, 2007 4:13 pm
Reply with quote

Hi there,

Assume you have more than one detailed record present (i.e., E2, E3 or E3, E4 or all E2 to E5 etc....) without main (E1) record. Then what do you want to do? i.e., you want to delete the records keeping one occurence of each key or want to retain all the available detailed records?
Back to top
View user's profile Send private message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Tue May 01, 2007 2:03 pm
Reply with quote

IF 'E1' IS NOT AVAILABLE...
Only 'E2','E3',etc....IS AVALILABLE...
THEN NO NEED TO DELETE ANY RECORD...HAS TO RETAIN AS IT IS..

If 'E1','E2',etc....PRESENT.........ONLY 'E1' HAS TO BE RETAIN..REMAINING 'E2',E3',etc...HAS TO BE DELETED...


THANK YOU
Back to top
View user's profile Send private message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Wed May 02, 2007 9:34 am
Reply with quote

Hi,
Please any one give a solution...its very urgent.

Frank where r u?

Expecting your reply.

Thank you
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: Wed May 02, 2007 8:46 pm
Reply with quote

I tend not to look at this kind of complicated situation if it's not in the DFSORT Forum since I do actually have my own work to do.

Do you have DFSORT? If so, why didn't you post in the DFSORT Forum?
Back to top
View user's profile Send private message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Thu May 03, 2007 9:31 am
Reply with quote

shall i post once again in DFSORT Forum?

tell me i will post it again.

I think i can't post the same post twice in Forum.

It will become duplicate.
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: Thu May 03, 2007 8:50 pm
Reply with quote

Hello,

To get the help you want, you need to reply to the questions presented to you.

From Frank:
Quote:
Do you have DFSORT?


If you have DFSORT, we can move your topic to the DFSORT forum. If you have some other sort product (Syncsort, CA-Sort, etc) your topic would not belong in the DFSORT forum.

And, no, you should not repost - this topic can be relocated once you provide the info.
Back to top
View user's profile Send private message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Fri May 04, 2007 9:25 am
Reply with quote

Yes.we having DFSORT utility.
you can give a solution using DFSORT.

Thank you
Back to top
View user's profile Send private message
Alain Benveniste

New User


Joined: 14 Feb 2005
Posts: 88

PostPosted: Fri May 04, 2007 2:20 pm
Reply with quote

ibmmainframesyntel,

How many Ex you can have for a main record ?

Alain
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Fri May 04, 2007 2:49 pm
Reply with quote

Hi there,

How many E1 records are you expecting? If the number of records are well within range of include/omit condition, try the following (this I have not tested, but may help you) -

(1) First extract all the E1 records only into temp file.
(2) Using this file, dynamically create a control card for omitting E2 or E3 etc.... records.

OMIT COND=((YOUR 1st KEY,AND,
E2 record,OR,
E3 record......),OR,
(YOUR 2nd KEY,AND,
E2 record,OR,
E3 record......),OR,.....)
(3) Apply the above dynamic control card against your file.
Back to top
View user's profile Send private message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Fri May 04, 2007 4:30 pm
Reply with quote

Number of Ex records is not constant.

One set of E1,E2,..etc are the details of one customer.
Like that millions of customer are available.
It can't predictable.
Back to top
View user's profile Send private message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Fri May 04, 2007 4:34 pm
Reply with quote

Hi murali,
Number of E1 records are more.
It contains millions of records.
so above JCL will not give the exact solution.
If I know the number of E1 record,then the above JCl will give the required solutuons

Thank you
Back to top
View user's profile Send private message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Fri May 04, 2007 4:46 pm
Reply with quote

Hi murali,
If it is possible,tell meknow hoe to implement the JCL
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: Fri May 04, 2007 10:42 pm
Reply with quote

I assume that XXXXXXXXXXXX indicates the customer number.

You seem to have two types of records. First type with a customer number like this:

Code:

000002 F1 E1 C 00000002 E108000070300000000002190051653710001000011108000070300
000003 F1 E2 C 00000003 E208000070300000000004190051653710000000000004001600000


and second type without a customer number like this:

Code:

000006 V1 E1 DKK-ACCT-TYPE-CD        DI F 0052                                 
000007 V1 E3 INF3-DSCNT-AMT          DI F 0036 +00000000000000                 
000008 V1 E3 INF3-DSCNT-AMT          DI F 0036       


It appears that the first type of records (with a customer number) are eligible for deletion, whereas the second type of records (without a customer number) are not eligible for deletion - is that true?

The two types of records makes a solution difficult.

The first type of records have the En field twice, whereas the second type of records have the En field once - is that true?

Can I use the second En field to identify the records that are eligible for deletion and to know if they are E1, E2, E3, etc?
Back to top
View user's profile Send private message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Sat May 05, 2007 11:52 am
Reply with quote

consider the first type of record.
The record having the customer number (ie) record starts with 'F1' from
1-2 position, not 'V1'

'V1' type of record from 1-2 position has to be retain as it is.

And in the record
F1 E1 C 00000002 E108000070300000000002....

consider first 'E1' for identifying the record (ie) from the position 4-5

Thank you
Back to top
View user's profile Send private message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Sat May 05, 2007 5:18 pm
Reply with quote

Inn the record
F1 E1 C 00000002 E108000070300000000002....

Don't consider the 'E1' which is in the position 18-19

Thank you
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 10:51 pm
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for. 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=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN= ...  input file (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file (FB/80)
//TOOLIN   DD    *
SPLICE FROM(IN) TO(T1) ON(20,12,CH) KEEPBASE KEEPNODUPS -
  WITHALL WITH(1,89) USING(CTL1)
SORT FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),
    IFTHEN=(WHEN=(1,5,CH,EQ,C'F1 E1'),OVERLAY=(89:C'BB')),
    IFTHEN=(WHEN=NONE,OVERLAY=(89:C'VV'))
  OUTFIL FNAMES=T1,OMIT=(89,2,CH,EQ,C'VB')
/*
//CTL2CNTL DD *
  SORT FIELDS=(81,8,ZD,A)
  OUTREC BUILD=(1,80)
/*
Back to top
View user's profile Send private message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Mon May 07, 2007 12:49 pm
Reply with quote

Hi frank,

yes i got it and i understood the complete JCL.


Thank you
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 DELETE SPUFI DB2 1
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top