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
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 |
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 |
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 |
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 |
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 |
How to recover a deleted source physical file from library?
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.
what is the basic concept of mainframe? what knowledge is needed for learn this mainframe?
Which is the best IBM mainframe Training Institute in Ameerpet, Hyderabad
What will happen if we try to create GDG (+2) generaton instead of (+1) generation?
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?
What is 77 level used for ?
if a file has 1000 recods how copy the records from 1 to 100 records using sort
how can u find out just by seeing wheater it is main program or sub program ? any two ways to identify reply soon ?
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?
What is the size of s9(19)comp3? explain
Explain the configuration section of a cobol program with examples of syntax.