ERROR #5001: <SYNTAX>zexecuteCode+3^%SYS.Task.RunLegacyTask.1

36 views
Skip to first unread message

Joshua Barney

unread,
Jun 7, 2013, 12:08:01 PM6/7/13
to InterSy...@googlegroups.com
Is there a way to figure out what is causing the syntax error? if I run the called program for TCL it process fine, when the task is initiated it returns this error as the status

John Lambert

unread,
Jun 7, 2013, 12:21:45 PM6/7/13
to InterSy...@googlegroups.com

Looks like you are sending a MV command string to the cache command processor.

If you precede the command with MV then it will invoke the MV shell to process the command.

 

John Lambert

 

 

--
You received this message because you are subscribed to the Google Groups "InterSystems: MV Community" group.
To post to this group, send email to Cac...@googlegroups.com
To unsubscribe from this group, send email to CacheMV-u...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/CacheMV?hl=en
---
You received this message because you are subscribed to the Google Groups "InterSystems: MV Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to InterSystems-...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Josh Barney

unread,
Jun 7, 2013, 12:23:15 PM6/7/13
to InterSy...@googlegroups.com

using

      CGULTASKNAME = "CleargageUploadTask"

      CGULTASKDESC = "Cleargage Upload Configuration"

      CGULTASKCLASS = "%SYS.Task.RunLegacyTask"

      CGULCMD = 'MVCALL CLEARGAGE_OUT_TASK'

      CGULSETTINGS = $LB("ExecuteCode",CGULCMD)

      CGULSTARTTIME = ICONV(CGREC<3>,"MT")

 

      ULTASK = "%SYS.Task"->OpenId(CGULTASKNAME)

      IF ISOBJECT(ULTASK) # 1 THEN

         ULTASK = "%SYS.Task"->%New()

      END

 

      ULTASK->Name = CGULTASKNAME

      ULTASK->Description = CGULTASKDESC

      ULTASK->TaskClass = CGULTASKCLASS

      ULTASK->Settings = CGULSETTINGS

      ULTASK->DailyStartTime = CGULSTARTTIME

      ULTASK->Suspended = 0

      ULTASK->NameSpace = SYSTEM(1002)

      IF CGREC<4> = "Y" THEN ULTASK->Suspended = 1

      ULTASK->%Save()

 

      ULGUID = ULTASK->JobGUID

      ULTASKID = ULTASK->%Id()

John Lambert

unread,
Jun 7, 2013, 12:39:14 PM6/7/13
to InterSy...@googlegroups.com

Does MVCALL CLEARGAGE_OUT_TASK work from the cache prompt rather than TCL?

Josh Barney

unread,
Jun 7, 2013, 12:42:54 PM6/7/13
to InterSy...@googlegroups.com

for setting up a task yeah. it works for another similar task but this one gets the syntax everytime

Edward Clark

unread,
Jun 7, 2013, 1:10:03 PM6/7/13
to InterSy...@googlegroups.com
I think the problem is the underscores in the program name. When I try to MVCALL a program with underscores, I get the syntax error. Underscores are the concatenation operator, and aren't valid in routine names.
 
A couple of things to try:
start a new terminal session but do not enter the mv shell. Run MVCALL CLEARGAGE_OUT_TASK from the objects script prompt. That will make sure that the command can really run outside the mv shell.
 
Instead of using MVCALL, add a line at the top of the program:
  #PRAGMA ROUTINENAME=CLEARGAGEOUTTASK
and recompile. Afterwards you can run it from object script just as
  DO ^CLEARGAGEOUTTASK
 


From: InterSy...@googlegroups.com [mailto:InterSy...@googlegroups.com] On Behalf Of Josh Barney
Sent: Friday, June 07, 2013 12:43 PM

Josh Barney

unread,
Jun 7, 2013, 1:11:34 PM6/7/13
to InterSy...@googlegroups.com

Will give it a try

Steve Johnson

unread,
Jun 7, 2013, 1:26:54 PM6/7/13
to InterSy...@googlegroups.com
We have underscores in our subroutine names, too. We this to call from COS:

Call MVBasic Subroutine from COS

Indirection -- @(variable name) -- must be used because the underscore in the subroutine name is the concatenation operator in COS.

 #; How to call a subroutine from COS (example)
 set sMsg="RT1-8"
 set sSubr="Sys_Msg"
 mvcall @(sSubr)(.sMsg)

Leave the "." prefix on each argument to call by reference (a value is returned in the argument variable), remove it to call by value (the argument variable is unchanged when the subroutine returns).

Regards,
Steve Johnson
Progenixx, Inc.

Josh Barney

unread,
Jun 7, 2013, 1:46:25 PM6/7/13
to InterSy...@googlegroups.com

That fixed it! Thanks guys

Reply all
Reply to author
Forward
0 new messages