Skip to Content
0
Former Member
Sep 24, 2008 at 07:20 AM

assigning value inside a case statement

707 Views

Hi friends

iam using the below code and can any one tell me why even after assigning the value in the case statement it coming out of it.

code

data :

p1(1) type n.

case p1.

when '0'.

write 'sunday'.

p1 = 1.

when '1'.

write 'monday'.

p1 = 2.

when others.

write 'invalid day'.

endcase.

output.

sunday

can any one tell me why it is coming out of the case statement even iam assigning p1 = 1