DATA Step, Macro, Functions and more

Double Quote in Script SH(Unix)

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Double Quote in Script SH(Unix)

Hi All,

I have a problem when I try invoke a shell DeployJobs from data step SAS.

 

For Example:

data _null_;
    length cmd_new $1000.;
    cmd_new='/u02/SAS/SASHome/SASDataIntegrationStudioServerJARs/4.8/DeployJobs -profile "Test" -deploytype deploy -objects "/MSCI/07 Test/Test_job" -sourcedir "/u02/SAS/sasdati/progettisas/passivi/programmi/pgm_sas/job_deploy/test" -deploymentdir "TESTDEPLOY" -metarepository Foundation -metaserverid "A5NH0LQQ.AT000005" -servermachine "lxbsl801.gbm.lan" -serverport 8592 -serverusername "sasadm@saspw" -serverpassword "SASpwd001" -batchserver "SASAppMSCI - SAS DATA Step Batch Server" -folder "/MSCI/06 Deploy/Test"';
    rc=system(cmd_new);
run;

 

This command remain in stand by.

In the shell command I execute this command

[sassrv@pippo script]$ ps -ef|grep sas|grep DeployJobs
sassrv    8049 58495  0 10:33 ?        00:00:00 /bin/sh /u02/SAS/SASHome/SASDataIntegrationStudioServerJARs/4.8/DeployJobs -profile Test -deploytype deploy -objects /MSCI/07 Test/Test_job -sourcedir /u02/SAS/sasdati/progettisas/passivi/programmi/pgm_sas/job_deploy/test -deploymentdir TESTDEPLOY -metarepository Foundation -metaserverid A5NH0LQQ.AT000005 -servermachine lxbsl801.gbm.lan -serverport 8592 -serverusername sasadm@saspw -serverpassword SASpwd001 -batchserver SASAppMSCI - SAS DATA Step Batch Server -folder /MSCI/06 Deploy/Test

 

The "Double Quote" is not send when I invoke the cmd.

 

If I use Put:

data _null_;
    length cmd_new $1000.;
    cmd_new='/u02/SAS/SASHome/SASDataIntegrationStudioServerJARs/4.8/DeployJobs -profile "Test" -deploytype deploy -objects "/MSCI/07 Test/Test_job" -sourcedir "/u02/SAS/sasdati/progettisas/passivi/programmi/pgm_sas/job_deploy/test" -deploymentdir "TESTDEPLOY" -metarepository Foundation -metaserverid "A5NH0LQQ.AT000005" -servermachine "lxbsl801.gbm.lan" -serverport 8592 -serverusername "sasadm@saspw" -serverpassword "SASpwd001" -batchserver "SASAppMSCI - SAS DATA Step Batch Server" -folder "/MSCI/06 Deploy/Test"';
    put cmd_new=;
 run;

 

In the log

cmd_new=/u02/SAS/SASHome/SASDataIntegrationStudioServerJARs/4.8/DeployJobs -profile "Test" -deploytype deploy -objects "/MSCI/07 Test/Test_job" -sourcedir "/u02/SAS/sasdati/progettisas/passivi/program
mi/pgm_sas/job_deploy/test" -deploymentdir "TESTDEPLOY" -metarepository Foundation -metaserverid "A5NH0LQQ.AT000005" -servermachine "lxbsl801.gbm.lan" -serverport 8592 -serverusername "sasadm@saspw" -
serverpassword "SASpwd001" -batchserver "SASAppMSCI - SAS DATA Step Batch Server" -folder "/MSCI/06 Deploy/Test" -log /u02/SAS/sasdati/progettisas/solvency2/cmn/files/file_logs/log_deploy.log
NOTE: The data set WORK.PIPPO has 1 observations and 1 variables.

 

 

 


Accepted Solutions
Solution
‎10-28-2016 03:38 AM
Super User
Super User
Posts: 7,413

Re: Double Quote in Script SH(Unix)

Well, I can't test this, so just going by what is in the documentation you might need to setup your quotes differently:

http://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#p028ivnihf9...

Have you tried it using X or the call system() functions?

View solution in original post


All Replies
Super User
Super User
Posts: 7,413

Re: Double Quote in Script SH(Unix)

Really not seeing what the question here is?  In the command you typed into shell you did not put double quote marks around certain paramters and it worked.  In SAS you are sneding out a string from SAS to shell with double quotes around certain parameters and it doesn't work.  Hence, remove the double quotes from around certain parameters in the string sent from SAS??

New Contributor
Posts: 2

Re: Double Quote in Script SH(Unix)

My question is :

Why SAS remove the Double Quote in Shell Script when execute the command?

The shell must to have quote or double quote in parameter.

Is possible to send quote or double quote in shell command?

 

 

 

 

Solution
‎10-28-2016 03:38 AM
Super User
Super User
Posts: 7,413

Re: Double Quote in Script SH(Unix)

Well, I can't test this, so just going by what is in the documentation you might need to setup your quotes differently:

http://support.sas.com/documentation/cdl/en/lefunctionsref/67960/HTML/default/viewer.htm#p028ivnihf9...

Have you tried it using X or the call system() functions?

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 237 views
  • 0 likes
  • 2 in conversation