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 have two questions here. 1. How to read a flat file in reverse order? 2. How to read a VSAM KSDS file in reverse order? In both the cases we donot know the total number of records.
If a sub program is called from mainprogram.I have opened cursor in main program and Fetch the result in subprogram ,Is it possible ?If yes please tell me the reason.
HELLO FRIENDS, THIS IS JANARDHAN.GADIRAJU, I FACED ONE INTERESTING QUESTION IN COBOL, THAT IS WHAT ARE THE VALUES WE CAN SEE IN HIGHVALUES AND LOWVALUES, CAN U PLEASE GIVE ME THE ANSWER
I have a occurs for 100 times but it has executed 101 time what could be the reason?
what happens if parmparameter passes zero bytes to the program
what are the error codes in cobol, db2, cics, vsam , and jcl
how to resolve the file status 47.......
What is amode(24)?
TO abend the data sholud open in which mode? 1.new 2.old 3.mod 4.shr
Consider the following code: 77 A PIC 99V99 VALUE 55.35 77 B PIC 99V999 VALUE 32.754 ADD B TO A ON SIZE ERROR DISPLAY "ERROR!!!" What will be the result ? (a) A=88.10, B=32.754 (b) A=87.00 B=32.754 (c) A=87.10 B=32.754 (d) ERROR!!! will be DISPLAYed on the screen.
What is JOBLIB and STEPLIB in JCL? what is the purpose of using it?
if a=b how the flow will complete??? perform test through test-exit. perform activa through activa-exit. test. if a=b then next sentence else move a to c. test-exit. exit. activa. -- -- activa-exit. exit.