Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

problem with if - elseif - endif.

Former Member
0 Likes
1,319

Hi,

Pls see this code

IF g_error = 'X'.

WRITE: / "File formatted incorrectly.".

ELSEIF tot_betrg NE g_tot_betrg OR g_tot_rec NE l_tot_rec .

WRITE: / 'summary record count does not match.'.

SKIP.

ENDIF.

This is giving me syntax error "Field elseif if unknown. It is neither in one of the specified tables nor defined by a 'data' statement.

Please help

Thanks

Pranati

1 ACCEPTED SOLUTION
Read only

kostas_tsioubris
Contributor
0 Likes
1,152

Hi,

maybe try this with single quotes

IF g_error = 'X'.

WRITE: / 'File formatted incorrectly.'.

....

Kostas

10 REPLIES 10
Read only

Former Member
0 Likes
1,152

Hi Pranati,

Modify your code in this way.

IF g_error = 'X'.

WRITE: / "File formatted incorrectly.".

ELSEIF.

tot_betrg NE g_tot_betrg OR g_tot_rec NE l_tot_rec .

WRITE: / 'summary record count does not match.'.

SKIP.

ENDIF.

Hope this resolves your query.

<b>Reward all the helpful answers.</b>

Regards

Read only

0 Likes
1,152

Hi,

Thanks for your help.. but it is not working

Thanks

pranati

Read only

Former Member
0 Likes
1,152

hi,

try like this

IF ( g_error = 'X' ).

WRITE: / "File formatted incorrectly.".

ELSEIF ( tot_betrg NE g_tot_betrg OR g_tot_rec NE l_tot_rec ) .

WRITE: / 'summary record count does not match.'.

ENDIF.

reward points if this helps u

ravi

Read only

0 Likes
1,152

Hi,

It is still not working..

Thanks

Pranati

Read only

Former Member
0 Likes
1,152

hi,

give period after elseif like

<b>ELSEIF.

tot_betrg NE g_tot_betrg OR g_tot_rec NE l_tot_rec .</b>

If helpful award points

Read only

kostas_tsioubris
Contributor
0 Likes
1,153

Hi,

maybe try this with single quotes

IF g_error = 'X'.

WRITE: / 'File formatted incorrectly.'.

....

Kostas

Read only

0 Likes
1,152

Hi,

it worked perfectly.. Thank you very much..

Thanks

Pranati

Read only

Former Member
0 Likes
1,152

Hi Paranati ,

Plese use the command

<b>WRITE: / 'File formatted incorrectly.'.</b>

Replace <b>"</b> with <b>'</b> .

Regards

Arun

Read only

Former Member
0 Likes
1,152

Paste this: ( rather than " " use ' ' ).

IF 1 = 2.

WRITE: / 'File formatted incorrectly.'.

ELSEIF tot_betrg NE g_tot_betrg OR g_tot_rec NE l_tot_rec .

WRITE: / 'summary record count does NOT match.'.

SKIP.

ENDIF.

Read only

Former Member
0 Likes
1,152

Pranati,

Remove double quotes.

WRITE: / 'File formatted incorrectly'.

Don't forget to reward if useful.