do-end if not working

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

do-end if not working

Raffe, Sydelle, SSA
Here is my do if - end if syntax.

do if (pgm_typ = 'CW' or pgm_typ eq 'MC').
  compute MC_only = '0'.
   else if (cs_id eq lag(cs_id) and lag(pgm_typ) eq 'CW').
  compute MC_only = '2'.
   else if (cs_id ne lag(cs_id) and pgm_typ eq 'MC').
  compute MC_only = '1'.
 else if (cs_id ne lag(cs_id) and pgm_typ eq 'CW').
 compute MC_only = '2'.
end if.

Upon executing, I get the following error:

        >Error # 4095.  Command name: EXECUTE
>The transformations program contains an unclosed LOOP, DO IF, or complex
>file structure.  Use the level-of-control shown to the left of the SPSS
>commands to determine the range of LOOPs and DO IFs.
>This command not executed.

Help please!



Sydelle Raffe, Alameda County Social Services Agency
Information Services Division
e:mail:  [hidden email]
phone: 510-271-9174     fax: 510-271-9107
If you have a request for information, please submit an ODM request form at:  https://alamedasocialservices.org/staff/support_services/statistics_and_reports/odm/index.cfm
Reply | Threaded
Open this post in threaded view
|

Re: do-end if not working

Melissa Ives
Is it possible that you ran part of this, got an error, corrected the
error (before running the 'end if' command), then re-ran the entire
thing?  If so, that would cause this error.

To solve, run the end if command.  Then start over with the full syntax.

Melissa

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Raffe, Sydelle, SSA
Sent: Wednesday, December 06, 2006 3:49 PM
To: [hidden email]
Subject: [SPSSX-L] do-end if not working

Here is my do if - end if syntax.

do if (pgm_typ = 'CW' or pgm_typ eq 'MC').
  compute MC_only = '0'.
   else if (cs_id eq lag(cs_id) and lag(pgm_typ) eq 'CW').
  compute MC_only = '2'.
   else if (cs_id ne lag(cs_id) and pgm_typ eq 'MC').
  compute MC_only = '1'.
 else if (cs_id ne lag(cs_id) and pgm_typ eq 'CW').
 compute MC_only = '2'.
end if.

Upon executing, I get the following error:

        >Error # 4095.  Command name: EXECUTE
>The transformations program contains an unclosed LOOP, DO IF, or
>complex file structure.  Use the level-of-control shown to the left of
>the SPSS commands to determine the range of LOOPs and DO IFs.
>This command not executed.

Help please!



Sydelle Raffe, Alameda County Social Services Agency Information
Services Division
e:mail:  [hidden email]
phone: 510-271-9174     fax: 510-271-9107
If you have a request for information, please submit an ODM request form
at:
https://alamedasocialservices.org/staff/support_services/statistics_and_
reports/odm/index.cfm



PRIVILEGED AND CONFIDENTIAL INFORMATION
This transmittal and any attachments may contain PRIVILEGED AND
CONFIDENTIAL information and is intended only for the use of the
addressee. If you are not the designated recipient, or an employee
or agent authorized to deliver such transmittals to the designated
recipient, you are hereby notified that any dissemination,
copying or publication of this transmittal is strictly prohibited. If
you have received this transmittal in error, please notify us
immediately by replying to the sender and delete this copy from your
system. You may also call us at (309) 827-6026 for assistance.