i have a requrement in A as viswa!@#$%&^**reddy i need to
move viswareddy in B without junk values pls say how to do
ths reply fast

Answers were Sorted based on User's Feedback



i have a requrement in A as viswa!@#$%&^**reddy i need to move viswareddy in B without junk val..

Answer / vinod

01 a pic x(19) value 'viswa!@#$%&^**reddy'.
01 b pix x(11).
procedure division.
move a(1:5) to b(1:5).
move a(15:5) to b(6:5).
display b.

Is This Answer Correct ?    17 Yes 1 No

i have a requrement in A as viswa!@#$%&^**reddy i need to move viswareddy in B without junk val..

Answer / priyanka

declare an 88 level with valid values as 'a' to 'z' and '0'
to '9'.
value = viswa!@#$%&^**reddy
move 0 to Y
move length of value to ws-value-length
Perform varying X from 1 by 1 until X > ws-value-length
move value (X:1) to 88-level-variable
if valid-value
add +1 to Y
move value(X:1) to out-value(Y:1)
else
continue
end-if
end-perform

out-value will be your output.

Is This Answer Correct ?    5 Yes 1 No

i have a requrement in A as viswa!@#$%&^**reddy i need to move viswareddy in B without junk val..

Answer / raghu

01 a pic x(19) value 'viswa!@#$%&^**reddy'.
01 b pix x(11).
procedure division.
perform a until ws-eof-str
if a is alphabetic
move a to b
display b
end-if
end-perform

Is This Answer Correct ?    0 Yes 0 No

i have a requrement in A as viswa!@#$%&^**reddy i need to move viswareddy in B without junk val..

Answer / guest

move a(1:5,15:5) to b

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More COBOL Interview Questions

Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc

0 Answers  


What will happen if we move SPACES to numeric field and ZEROES to alphabetic field?

2 Answers  


How can we increase the size of an existing PDS to include more no. of modules. I tried the answer posted by Jagan(TSO PDS 'pds name') but did not find it working. The answer posted by kamal i know very well. Please suggest me a answer so that we don't need to delete the existing PDS and still we can change the size as well.

10 Answers  


Read filea And file b write the same records in both files? Records in a but not in b record in b but not in a

3 Answers   TCS,


in how many mode we can open a file ?

4 Answers  






How do you reference the fixed block file formats from cobol programs

0 Answers  


What is the Linkage section? What is the Use and Why the parm length use alway "PARM-LENGTH PIC S9(4) or PIC S9 (4) COMP." any reason?.Please let me know any one... Cheers,Prasad

8 Answers   Syntel,


The order of precedence of arithmetic operators in an expression can be overridden with the use of (a) [] (b) () (c) {} (d) Any of the above

3 Answers   TCS,


what is jcl approach for programming?

4 Answers   IBM,


Which of the following characters is NOT valid in column 7? a. - b. \ c. * d. # e. $

4 Answers  


how do u indetify files succesfully executed or not ?

4 Answers   TCS,


how do you reference the ksds vsam file formats from cobol programs

0 Answers  


Categories