Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

i want all ERRORS codes in COBOL ,JCL,VSAM ,DB2,CICS

4 Answers   Infosys,


HOW TO MOVE REDEFINES CLAUSE FROM INPUT TO OUTPUT ?

1 Answers  


What is the difference between COMP & COMP-3 ?

2 Answers  


How to retrive the 9th records out of ten records using the cobol program ?

3 Answers   UST,


how do you reference the rrds file formats from cobol programs

0 Answers  


what is index and how to use two tables using index?

1 Answers  


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?

7 Answers  


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)

1 Answers   Cap Gemini,


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

0 Answers  


Write some characteristics of cobol as means of business language.

0 Answers  


how do you reference the printer file formats from cobol programs

0 Answers  


How to covert given string into ASCII value in COBOL/MF COBOL

3 Answers   CTS, IBM, iFlex,


Categories