View previous topic :: View next topic
|
Author |
Message |
surya4ug
New User
Joined: 08 Jul 2008 Posts: 62 Location: chennai
|
|
|
|
Hello,
Is there a way to count the no of CONSECUTIVE non-zero or not-space characters in a field ( 8 digits) using SYNCSORT. The field can have
the the following values in the respective digits
1 or space in position 1
2 or space in position 2
3 or space in position 3
4 or space in position 4
5 or space in position 5
6 or space in position 6
7 or space in position 7
8 or space in position 8
Ex:
If we have a value
, i want to return
because, there are 2 sets of numbers (1,2 and 7,8) that have occured consecutively.
and if we have a value
, i want to return '3'
and if we don't have any consecutive numbers, i want to return '0'.
please assist. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I believe your "rules" do not match your examples. . . (or i don't completely understand the rules).
Please explain how the results were determined. 123 is only 1 set of numbers
What should happen if the data is:
|
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Throwing in with Dick, where is the source/justification for such a requirement? Interview question? COBOL 101 test? Sort/Utilities test?
Your requirement may be what it is, but what is the requirement looking for? Not what are you looking for, but what does the requirement require?
Ya know, surya4ug (BTW, what does that stand for?), 'we' kind of know more than one way to do something, and if you let us know just what you are trying to do, 'we' can probably help better than you just looking for another way....... |
|
Back to top |
|
|
surya4ug
New User
Joined: 08 Jul 2008 Posts: 62 Location: chennai
|
|
|
|
I'm so sorry, i have done it easy with ezytrieve. Just was getting too mad abt syncsort and i didn't sound clear in my requirement either...
Sorry for wasting your time. |
|
Back to top |
|
|
|