hi Pinky
just follow the below code. i think it will work for it.
ws-first-time pic x(01) value 'y'.
ws-end-of-file pic x(01) value 'n'.
open input-file.
perform read-para
until ws-end-of-file 'y'.
close input-file.
stop run.
read-para.
**********
read input-file
at end move 'y' to ws-end-of-file
if ws-end-of-file 'y'
if ws-first-time 'y'
move '4' to RETURN-CODE
end-if
else
move 'n' to ws-first-time
end-if
Regards
Saikrishna Yadav Jinka
jinka.saikrishna@gmail.com