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
 

 

Selecting records with incremental data

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sujithsamuel

New User


Joined: 22 Dec 2006
Posts: 11
Location: Chennai

PostPosted: Wed May 11, 2011 3:07 pm    Post subject: Selecting records with incremental data
Reply with quote

Hi

I have a requirement in which i need to select records from a file which are having incremental data. E.g.

My input file has the following records

abcdef1234
abcdef12345
abcdef123456
cdef456
cdef4
cdef678

My output file should be

abcdef123456
cdef456
cdef678

The LRECL for the file is 80 bytes.

Kindly clarify

Thanks
Back to top
View user's profile Send private message

sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Wed May 11, 2011 7:34 pm    Post subject:
Reply with quote

sujithsamuel,
How do you define "incremental"? Are you looking for a difference of certain number between 2 consecutive records? Also, please use code tags to keep alignment of your sample input data. What is the field size for both the fields (abcdef and 1234)?

Thanks,
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1722
Location: UK

PostPosted: Wed May 11, 2011 11:40 pm    Post subject:
Reply with quote

And why do you have 2 output records for 'cdef' when you only have 1 for 'abcdef'?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Thu May 12, 2011 12:55 am    Post subject: Reply to: Selecting records with incremental data
Reply with quote

my guess

records are <incrementalized> based on a common root

abcdef records share a common root 1234

cdef record are in two groups
one with a root 4
one with a root 678


anyway it might be an interesting problem for something that could be worded
as strict incremental substring matching

but really the way the question is posed looks more like a puzzle

since we answer on our own time and at no charge I feel that we are entitled
to a proper explanation of the business need for such a nonsense ( the way the question is worded )
Back to top
View user's profile Send private message
sujithsamuel

New User


Joined: 22 Dec 2006
Posts: 11
Location: Chennai

PostPosted: Thu May 12, 2011 8:42 am    Post subject: Reply to: Selecting records with incremental data
Reply with quote

Dear Enrico

abcdef1234
abcdef12345
abcdef123456
cdef456
cdef4
cdef678

My output file should be

abcdef123456
cdef456
cdef678

The LRECL for the file is 80 bytes.

The reason abcdef123456 is only selected is that abcd1234 and abcd12345 are already present in the record abcdef123456.
I have to select a record which is the superset of all the existing records and discard all the other records which are a subset of any existing record.

By the same logic since cdef4 is already contained in cdef456, it was not selected.

Thanks
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Thu May 12, 2011 10:32 am    Post subject: Reply to: Selecting records with incremental data
Reply with quote

since I understood Your question no reason to address me personally,

but You! did You read and understand my reply ? looks like not icon_evil.gif

as I said before we have the requirement that ..
Quote:
since we answer on our own time and at no charge I feel that we are entitled
to a proper explanation of the business need for such a nonsense


in other words ...
when You hire a paid <consultant> You have the right to ask him/her to do something without explanation

since we answer on our own time and at no charge we are entitled to some respect and not be treated like children and bossed around
You should feel at least the ethical duty of telling the reason for the requirement

if You are not prepared to do so, You should not ask help on a forum

also explaining the business requirement might help to find a better description and definition of the technical aspects of the requirement

Kindly clarify
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Thu May 12, 2011 11:27 am    Post subject: Reply to: Selecting records with incremental data
Reply with quote

follow on ...
anyway You need to define properly incremental...
should the <incremented> character be srictly incremental like in the sample You posted or

qwert123
qwert123567
qwert12356790

should give back
qwert12356790 ???
the 4 and th 8 are missing

asdf7654
asdf7654321

should give back
asdf7654321 ???

there is quite a difference between prefix string matching as in the samples I posted

it could be called <incremental> by length or by proper substringing

Your examples seems to imply a strict/no holes sequencing of partial/full <key>

You see setting a proper/common terminology/dictionary is essential fo proper communication and <requirement> understanding

but... i dare to say that no general purpose utility will be able to do it
and even coding a program will not be a trivial task !
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 Sorting group data rajella DFSORT/ICETOOL 3 Sun Jan 22, 2017 11:32 pm
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm


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