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
 

 

Count no. of consecutive non-zero or not-space characters

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
surya4ug

New User


Joined: 08 Jul 2008
Posts: 62
Location: chennai

PostPosted: Sat May 22, 2010 2:19 am    Post subject: Count no. of consecutive non-zero or not-space characters
Reply with quote

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
Code:
12    78
, i want to return
Code:
 '2'
because, there are 2 sets of numbers (1,2 and 7,8) that have occured consecutively.

and if we have a value
Code:
123     
, i want to return '3'


and if we don't have any consecutive numbers, i want to return '0'.

please assist.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat May 22, 2010 3:24 am    Post subject:
Reply with quote

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 icon_confused.gif

What should happen if the data is:
Code:
12 345 6
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Sat May 22, 2010 5:14 am    Post subject:
Reply with quote

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
View user's profile Send private message
surya4ug

New User


Joined: 08 Jul 2008
Posts: 62
Location: chennai

PostPosted: Fri Jun 04, 2010 1:55 am    Post subject: Reply to: Count no. of consecutive non-zero or not-space cha
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts VSAM Space Allocation mrgnndhmk JCL & VSAM 7 Sat Apr 22, 2017 12:42 am
This topic is locked: you cannot edit posts or make replies. Need help in estimating space of unlo... ashek15 IMS DB/DC 12 Fri Apr 07, 2017 5:11 am


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