1.find most occurrences of a character.

for exm: input:aaabbbbdddddyyy
output: d 5 times
how can i get that?


Answer Posted / vipul dixit

With the help of %Scan built in function or Scan op-code we
can do this.
we should define a data structure and write like this way:-

DDs s
C Eval Ds = %Scan('d':Source:1).
It will fetch the position of the scanned character,and
after that we will count all the positions as DS elements.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many program bind in one module....

2336


What are the types of identifiers?

752


can anybody help me to solve this problem. the program that i m checking display error message saying "Record format for file AJDSPFFD does not match model file and decimal error. how to solve this problem. The AJDSPFFD is snapshot the AJTLOG that is the audit trail list.

2533


what is an online rpg?

959


What is the difference between copybooks and subprocedures in as400?

1070


what is the difference between do while and do until?

925


how does the rpg element work?

922


what is file information data structure?

1734


what do you mean by an input subfile, what are the keywords required?

1010


how do you use commitment control in rpg?

973


1. If there are two programs using same file and 2 users are using the file at the same time and what can be done to allow them both to access? 2. How can remove lock from the file for accessing it by both users?

699


How to call one program from another program in RPG? please help me with the code

1462


how can you display specific subfile page on the screen in unequal subfile?

887


is this a rpg channel?

874


are there any useful c runtime apis that I can call from rpg iv?

889