Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : When you specified V for RECFM parameter, LRECL value is largest record in the file plus 4 bytes. These four bytes contain the actual length of each variable length record in the file

Google
 
Web mainframegurukul.com

removing duplicates from a group

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities
  View previous topic :: View next topic  
Author Message
karthi5555
Member


Joined: 01 Dec 2015
Posts: 6

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Dec 11, 2015 9:01 pm    Post subject: removing duplicates from a group Reply with quote

Hi,

Can you please help with removing duplicate block..

Input file:
HDR1
DTL1
DTL2
DTL3
HDR2
DTL1
DTL2
HDR1 -- Duplicate
DTL1
DTL2
DTL3

HDR1
DTL1
HDR2
DTL2
DTL3

Output Expected:
HDR1
DTL1
DTL2
DTL3
HDR2
DTL1
DTL2
HDR1
DTL1
HDR2
DTL2
DTL3
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.

William Collins
Active Member


Joined: 24 May 2012
Posts: 732

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Dec 11, 2015 9:49 pm    Post subject: Reply with quote

How do you know it is duplicate?
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
karthi5555
Member


Joined: 01 Dec 2015
Posts: 6

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Dec 14, 2015 9:43 am    Post subject: Reply with quote

HDR.. DTL is a block.
If that repeats (color coded) , it has to be removed.

Input file:

HDR1 -- Original block blk #1
DTL1
DTL2
DTL3

HDR2 ---------------------- blk #2
DTL1
DTL2
HDR1 --------- Duplicate Blk#3
DTL1
DTL2
DTL3

HDR1 ---------------------- blk #4
DTL1
HDR2 ---------------------- blk #5
DTL2
DTL3
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
William Collins
Active Member


Joined: 24 May 2012
Posts: 732

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Dec 14, 2015 12:26 pm    Post subject: Reply with quote

OK, but SORT has no support for colour-recognition. How is SORT supposed to know the group is duplicate? Note, this is the same question, you provided nothing with this "cute" answer.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
karthi5555
Member


Joined: 01 Dec 2015
Posts: 6

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Dec 15, 2015 2:51 am    Post subject: Reply with quote

The color coding is not for the sort but for the members for better understanding of the problem in hand.

Just to rephrase my question -
Can the sort remove duplicate on the (HDR-DTL) block level instead of individual record ?

Note: 'HDR' denotes the beginning of the block and that block continues as 'DTL' till the next HDR (or end of file) is encountered.

To answer your question - how is sort supposed to know if it was duplicate ?
Sort needs to accumulate the record as block and then compare with every block to see if it had any match. If the match is positive, don't write the block to the output.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
William Collins
Active Member


Joined: 24 May 2012
Posts: 732

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Dec 15, 2015 4:13 am    Post subject: Reply with quote

At last.

What is the maximum number of detail records? LRECL and RECFM?

Is this a once-off (data fix) or a regulat task (if yes, why?).
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
karthi5555
Member


Joined: 01 Dec 2015
Posts: 6

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Dec 15, 2015 8:47 pm    Post subject: Reply with quote

Number of detail records can be anywhere from 1 to n ( based on the prod data - 'n' could be 50,000 records) very dynamic .

LRECL - 61 , RECFM- FB

Currently, this is a production issue we found out recently and trying to address. So, if the fix is deployed - it should filter out all the duplicate blocks.

Why duplicating ?
When the user scans the shipment twice (or multiple times), the scanned data will be sent from DC to mainframe as many times. This human error happens once a while.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
srijayam
Member


Joined: 05 Jan 2016
Posts: 2

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Jan 05, 2016 2:14 pm    Post subject: Reply with quote

As a beginner like me, this is so helpful.
_________________
marriage catering services in chennai
Back to top
View user's profile Send private message Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
William Collins
Active Member


Joined: 24 May 2012
Posts: 732

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue Jan 05, 2016 3:10 pm    Post subject: Reply with quote

srijayam,

That's a lie. You are simply posting that to introduce SPAM to the site.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
karthi5555
Member


Joined: 01 Dec 2015
Posts: 6

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Jan 14, 2016 11:50 pm    Post subject: Reply with quote

I am looking forward to getting an answer for this post..
Please .. Any directions/suggestions would help ..
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
William Collins
Active Member


Joined: 24 May 2012
Posts: 732

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Jan 15, 2016 4:08 pm    Post subject: Reply with quote

If there is nothing to distinguish one group of records from another, then every group in the file has to be compare to every other group in the file. Can you show better examples of the data? Needs a key to be able to work.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
srijayam
Member


Joined: 05 Jan 2016
Posts: 2

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Jan 25, 2016 4:24 pm    Post subject: Reply Reply with quote

Hi William Collins, I have not replied this thread for making it Spam. I am not in the need to do this. I have heard many thing about Forums. So y i joined.
_________________
marriage catering services in chennai
Back to top
View user's profile Send private message Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
William Collins
Active Member


Joined: 24 May 2012
Posts: 732

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Jan 25, 2016 7:28 pm    Post subject: Reply with quote

Untrue, and you prove it again.

If it were true you were here innocently, you wouldn't have that spam link, would you? If you are here to be serious, get rid of the link. If not here to be serious, get rid of yourself.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
academyindia4
Guest





Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Jan 25, 2016 9:41 pm    Post subject: Topic deleted by Admin Reply with quote

<< Content deleted By Admin >>
Back to top
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> DFSORT , ICETOOL & Utilities All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Cobol Tutorial
This cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3.....
DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters
CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming...
JCL Tutorial
This is most popular JCL tutorial from mainframegurukul. It does contain important jcl ....
SORT Tutorial
This Tutorial covers all important aspects of DFSORT. Has more SORT examples
INTERVIEW Questions
This page covers important interview questions
Mainframe Jobs
Mainframe Jobs posted by members of mainframegurukul forum
FaceBook Page
MainframeGurukul FaceBook Page
LinkedIn Page
MainframeGurkul Linkedin Page

This widget requires Flash Player 9 or better







Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials || Mainframe CICS tutorial|| Mainframe COBOL Tutorial

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB

mainframetopic-7975.html