SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
How to quote v-parameters?

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
How to quote v-parameters?
Author Message
barefootguru



Joined: 10 Aug 2007
Posts: 195

Post How to quote v-parameters? Reply with quote
Hi guys,

I'm wanting to pass the @V"message" and @V"subject" parameters to one of my jobs but I can't get my head around quoting the values.

This is the current working command line I'm wanting to add message and subject to:

sasbatch.bat "@V"env:HSProgs"\ETL\CBGSurvey\sasprogs\EMailDispatcher.sas" /a "%let sender=@V"sender"; %let attachments=@V"attachments";"

But of course if the user enters a double quote in the subject/message or semicolon it's going to upset things.

I could start the job with a Javascript Process.start but then I run into the same problem--how can I handle any character the user throws at me?

Thanks
Mon Mar 16, 2009 6:17 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7847

Post Reply with quote
In case the message is a single text line value, you should be able to pass it along with the subject some way or another, perhaps using a wrapper script. If it is a multiple-line value, the resulting command line will be invalid.

Also, as you correctly said, if a user specifies double-quotes or semicolons in the message, they will break the command line. Since you don't know in advance what to expect, you are out of luck. Dealing with variable subject or message text is a difficult. Macro-variables are substitution type variables whose values in job run-time are inserted into job properties or scripts as is. Basically, there is no time to replace quotes or other special symbols before the value is inserted. And the resulting property becomes invalid if that an executable type property like job command line. This method is only appropriate when the text is well known in advance and so you know how to use it.


Do you have any other means for reading incoming emails so that you can save them to a file and then have the job read it from that file?
Mon Mar 16, 2009 7:49 pm View user's profile Send private message
barefootguru



Joined: 10 Aug 2007
Posts: 195

Post Reply with quote
OK, thanks for confirming.

I'm already reading the subject and message body from message.txt in the temp directory, but if another e-mail comes in before I've processed the first it gets overwritten--hence wanting to use the V-parameters.

Maybe in a future version you could add escaped versions of message and subject, so they're safe to use within Javascript?

e.g. A user e-mails a message of:

Alice said "Hi" to Bob.

and @V"messagequoted" would resolve to:

Alice said \"Hi\" to Bob.

Then a Javascript statement such as this would always be 'safe':

var mymessage="@V"messagequoted""

Cheers
Mon Mar 16, 2009 8:07 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7847

Post Reply with quote
I agree, that would easy the pain.
Mon Mar 16, 2009 8:26 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.