i need a program by giving input as a abcd in any randem order
but i need a output as 1234 related to abcd. i.e,. a for
1,b=2,c.....etc..

Answers were Sorted based on User's Feedback



i need a program by giving input as a abcd in any randem order but i need a output as 1234 related..

Answer / parvatraj m bhuti

first we have to initialize the letters a=1,b=2,....
like that z=26..

then we have to read the variable v pic x(4)( which may be
abcd or any other) from input

Then we have to un string the variable v into 4 other
variables as a1,a2,a3,a4.

then
compute x1= (a1*10)+a2;
compute x2= (x1*10)+a3;
compute x3= (x2*10)=a4;

Then display ('answer is = ", x3);
That will be the answer.

Is This Answer Correct ?    2 Yes 0 No

i need a program by giving input as a abcd in any randem order but i need a output as 1234 related..

Answer / kamaldeep

We can use:
INSPECT ws-var1 CONVERTING 'ABCD' TO '1234'.
this will replace a with 1, b with 2, c with 3 & d with 4

Is This Answer Correct ?    2 Yes 0 No

i need a program by giving input as a abcd in any randem order but i need a output as 1234 related..

Answer / prasad bhavanasi

through EVALUATE WE CAN GET THE output wt asked the q.


if a=1,b=2,o=15,z=26...etc if u want fulfil this kind of
requirment thru only EVALUATE ONLY.....In interviews this
type questions asks only for ur thinking...thats it...no
need to think very deep...all the best

Is This Answer Correct ?    2 Yes 1 No

i need a program by giving input as a abcd in any randem order but i need a output as 1234 related..

Answer / prasad

i need a program by giving input as a abcd in any randem order
but i need a output as 1234 related to abcd. i.e,. a for


ex a=1,b=2,c=3 like this
or

c=3c<b,b<a.

Is This Answer Correct ?    0 Yes 2 No

i need a program by giving input as a abcd in any randem order but i need a output as 1234 related..

Answer / krishnan

EVALATE ABCD
WGEN 'ABCD'
DISPLAY '1234'
WHEN 'BCDA'
DISPLAY '1234'
Like that we will try i this is not a proper method but
they need only the output is 1234 means we try this also

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More COBOL Interview Questions

How to recover a deleted source physical file from library?

1 Answers   HCL,


There is a production file which has millions of records in it.The program that uses it ends up with an SOC7 abend.It is sure that the abend is due to some invalid data in the file.Is there any way to debugg the SOC7 abend with out giving displays? I need the record which is cause for the abend.

8 Answers   Danske, iGate,


what is the basic concept of mainframe? what knowledge is needed for learn this mainframe?

4 Answers   CSE, TCS, Wipro,


Which is the best IBM mainframe Training Institute in Ameerpet, Hyderabad

35 Answers  


What will happen if we try to create GDG (+2) generaton instead of (+1) generation?

1 Answers  






I have a variable account-number declared as comp-3, s9(10) comp-3 in a file. How do i find a particular account number say 123456 in that file?

3 Answers  


What is 77 level used for ?

12 Answers   IBM, iGate,


if a file has 1000 recods how copy the records from 1 to 100 records using sort

4 Answers   IBM,


how can u find out just by seeing wheater it is main program or sub program ? any two ways to identify reply soon ?

2 Answers  


i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?

0 Answers  


What is the size of s9(19)comp3? explain

8 Answers  


Explain the configuration section of a cobol program with examples of syntax.

0 Answers  


Categories