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 |
i want all ERRORS codes in COBOL ,JCL,VSAM ,DB2,CICS
HOW TO MOVE REDEFINES CLAUSE FROM INPUT TO OUTPUT ?
What is the difference between COMP & COMP-3 ?
How to retrive the 9th records out of ten records using the cobol program ?
how do you reference the rrds file formats from cobol programs
what is index and how to use two tables using index?
01 a pic s9(5) value -12345, if we disply a , the sign will overpunched with last digit but i need to get the miuns sign in the result?
We know that size of redefine and redefining need not to be same..Then does the below case true 01 ws-date pic 9(6). 01 ws-redf-date REDEFINES ws-date 05 ws-year pic 9(4) 05 ws-mon pic 9(2) 05 ws-day pic 9(2)
write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc
Write some characteristics of cobol as means of business language.
how do you reference the printer file formats from cobol programs
How to covert given string into ASCII value in COBOL/MF COBOL