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 |
What is the difference between SEARCH and SEARCH ALL?
ZEROES and SPACES are _______ constants (a) Figurative (b) Numeric (c) Non-numeric (d) Alphabete
Suppose i want to declare a binary comp fild of 7 byte .how to write?
plz,could any one tell me? what about EBCDIC in cobol?briefly?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
What is the difference between a binary search and a sequential search what are the pertinent cobol?
In the JCL, how do you define the files referred to in a subroutine ?
i want to store 20 digits . h will u do it in cobol ?
What is the Importance of GLOBAL clause According to new standards of COBOL?
How to read the last 100 records from a COBOL file. The file contains N number of records.
What is the difference between Global and External Variables?
What is the difference between perform … with test after and perform … with test before?