LOOP & Input Program

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

treppy76
Posts: 2
Joined: Fri Mar 01, 2013 2:30 pm

LOOP & Input Program

Postby treppy76 » Wed Mar 06, 2013 3:23 pm

Hi all,

I wrote code to clean a text variable and I would like to repeat the same code few time so I need a loop.

code I need to repeat is:

DO IF (q15_SKY = 0).
Q15newSKY var='skybet' 'sky bet' 'sky' .
END IF.
EXECUTE.


DO IF (q15_SKY = 1).
COMPUTE question15spontaware.r01 = replace(question15spontaware.r01, 'skyaaa','').
COMPUTE question15spontaware.r01 = replace(question15spontaware.r01, 'sky','').
COMPUTE question15spontaware.r01 = replace(question15spontaware.r01, 'sky ','').
END IF.
EXECUTE.

COMPUTE question15spontaware.r01=LTRIM(question15spontaware.r01).
EXECUTE.


please note Q15newSKY is a macro.

I am struggling as I believe I need to use "input program" but when I use it I get an error.

Could you help me please?

Thanks

Who is online

Users browsing this forum: No registered users and 6 guests

cron