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

Selecting records with incremental data


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 577
Location: USA

PostPosted: Wed May 11, 2011 7:34 pm
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: 2455
Location: Hampshire, UK

PostPosted: Wed May 11, 2011 11:40 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu May 12, 2011 12:55 am
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu May 12, 2011 10:32 am
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu May 12, 2011 11:27 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top