April 25, 2007, 10:40 AM
saltroggeHaving Trouble with GOTO statements
I'm having trouble getting the following goto statements to work.
-IF '&SEC_LINE' EQ 'SEC010_LN020' THEN GOTO SEC010_LN020
- ELSE IF '&SEC_LINE' EQ 'SEC010_LN040' THEN GOTO SEC010_LN040;
-SEC010_LN020
WHERE ACC_TYPE EQ '1' OR '2';
WHERE TC NE '6018';
WHERE PST_FLG EQ 'Y';
-GOTO ENDWHERE
-SEC010_LN040
WHERE ACC_TYPE EQ '3' OR '4';
WHERE TC NE '6118';
WHERE PST_FLG EQ 'Y';
-GOTO ENDWHERE
-ENDWHERE
The fex seems to execute the first label no matter what. Could you please help me on this? Thanks
Stephen A
April 25, 2007, 10:51 AM
<Tim Howard_ABCBS>Try taking the ticks of the & Variables:
-IF '&SEC_LINE' EQ 'SEC010_LN020' THEN....
should be
-IF &SEC_LINE EQ 'SEC010_LN020' THEN....
April 25, 2007, 10:53 AM
susannahor,
just
-GOTO &SEC_LINE ;
We don't know your platform/version (edit your profile signature), so just make sure your statement labels are 12 chars max in length.
April 25, 2007, 10:55 AM
Lucasquote:
'&SEC_LINE'
Try removing the ' ' ticks, just a guess.......
April 25, 2007, 11:19 AM
KevinGAnd if removing the ticks doesn't work, split the DM into 2 distinct statements by removing the ELSE and terminating the first line with ;
Kevin
April 25, 2007, 11:32 AM
Darin LeeGo with Susannah's suggestion
April 25, 2007, 11:32 AM
saltroggeYou folks are geniuses. Removing the tick marks solved the problem...
Stephen A