SAS SYSCC Macro Variable Behaviour












0















It is my understanding that if a SAS process hits an error that the value of &SYSCC. will not be 0. which is the success return code. I am writing said variable to a text file to act as a go/no go signal to a Python script that I am using to orchestrate some wider processes.



Whilst testing the behaviour of said variable by triggering some simple, deliberate errors I have noticed that it is still returning zero:



%macro test;


sdsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfs

%put &syscc. **********************************;

%mend;

%test;


Have I misunderstood something?



Thanks










share|improve this question



























    0















    It is my understanding that if a SAS process hits an error that the value of &SYSCC. will not be 0. which is the success return code. I am writing said variable to a text file to act as a go/no go signal to a Python script that I am using to orchestrate some wider processes.



    Whilst testing the behaviour of said variable by triggering some simple, deliberate errors I have noticed that it is still returning zero:



    %macro test;


    sdsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfs

    %put &syscc. **********************************;

    %mend;

    %test;


    Have I misunderstood something?



    Thanks










    share|improve this question

























      0












      0








      0








      It is my understanding that if a SAS process hits an error that the value of &SYSCC. will not be 0. which is the success return code. I am writing said variable to a text file to act as a go/no go signal to a Python script that I am using to orchestrate some wider processes.



      Whilst testing the behaviour of said variable by triggering some simple, deliberate errors I have noticed that it is still returning zero:



      %macro test;


      sdsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfs

      %put &syscc. **********************************;

      %mend;

      %test;


      Have I misunderstood something?



      Thanks










      share|improve this question














      It is my understanding that if a SAS process hits an error that the value of &SYSCC. will not be 0. which is the success return code. I am writing said variable to a text file to act as a go/no go signal to a Python script that I am using to orchestrate some wider processes.



      Whilst testing the behaviour of said variable by triggering some simple, deliberate errors I have noticed that it is still returning zero:



      %macro test;


      sdsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfs

      %put &syscc. **********************************;

      %mend;

      %test;


      Have I misunderstood something?



      Thanks







      sas






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 20 '18 at 10:57









      gdogg371gdogg371

      1,28353162




      1,28353162
























          1 Answer
          1






          active

          oldest

          votes


















          3














          This is a timing issue. No error has been generated at the point at which the %put statement executes. The %test macro generates some text (sdsfsdfs..) and writes a valid put statement. The semicolon after the macro invocation ; creates a statement boundary (sdsfsdf...;) which then throws an error.



          Order of execution:



          1) compile macro



          2) execute macro (%test)



          3) execute %put statement



          4) send sdsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfs to input stack



          5) finish executing macro



          6) send final semicolon to input stack (;)



          7) sdsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfs; is executed, which likely throws an error (it's too long to be a variable name but could be part of a valid %let statement);






          share|improve this answer
























          • yes i see that now, thanks. when i added a semi colon after my nonsense string SAS returned an error code of 3000...my test case for an error is unlikely to happen when my code gets to a batch state as finger trouble such as missing semi colons will have been ironed out whilst developing the code interactively...

            – gdogg371
            Nov 20 '18 at 11:56











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53391488%2fsas-syscc-macro-variable-behaviour%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3














          This is a timing issue. No error has been generated at the point at which the %put statement executes. The %test macro generates some text (sdsfsdfs..) and writes a valid put statement. The semicolon after the macro invocation ; creates a statement boundary (sdsfsdf...;) which then throws an error.



          Order of execution:



          1) compile macro



          2) execute macro (%test)



          3) execute %put statement



          4) send sdsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfs to input stack



          5) finish executing macro



          6) send final semicolon to input stack (;)



          7) sdsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfs; is executed, which likely throws an error (it's too long to be a variable name but could be part of a valid %let statement);






          share|improve this answer
























          • yes i see that now, thanks. when i added a semi colon after my nonsense string SAS returned an error code of 3000...my test case for an error is unlikely to happen when my code gets to a batch state as finger trouble such as missing semi colons will have been ironed out whilst developing the code interactively...

            – gdogg371
            Nov 20 '18 at 11:56
















          3














          This is a timing issue. No error has been generated at the point at which the %put statement executes. The %test macro generates some text (sdsfsdfs..) and writes a valid put statement. The semicolon after the macro invocation ; creates a statement boundary (sdsfsdf...;) which then throws an error.



          Order of execution:



          1) compile macro



          2) execute macro (%test)



          3) execute %put statement



          4) send sdsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfs to input stack



          5) finish executing macro



          6) send final semicolon to input stack (;)



          7) sdsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfs; is executed, which likely throws an error (it's too long to be a variable name but could be part of a valid %let statement);






          share|improve this answer
























          • yes i see that now, thanks. when i added a semi colon after my nonsense string SAS returned an error code of 3000...my test case for an error is unlikely to happen when my code gets to a batch state as finger trouble such as missing semi colons will have been ironed out whilst developing the code interactively...

            – gdogg371
            Nov 20 '18 at 11:56














          3












          3








          3







          This is a timing issue. No error has been generated at the point at which the %put statement executes. The %test macro generates some text (sdsfsdfs..) and writes a valid put statement. The semicolon after the macro invocation ; creates a statement boundary (sdsfsdf...;) which then throws an error.



          Order of execution:



          1) compile macro



          2) execute macro (%test)



          3) execute %put statement



          4) send sdsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfs to input stack



          5) finish executing macro



          6) send final semicolon to input stack (;)



          7) sdsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfs; is executed, which likely throws an error (it's too long to be a variable name but could be part of a valid %let statement);






          share|improve this answer













          This is a timing issue. No error has been generated at the point at which the %put statement executes. The %test macro generates some text (sdsfsdfs..) and writes a valid put statement. The semicolon after the macro invocation ; creates a statement boundary (sdsfsdf...;) which then throws an error.



          Order of execution:



          1) compile macro



          2) execute macro (%test)



          3) execute %put statement



          4) send sdsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfs to input stack



          5) finish executing macro



          6) send final semicolon to input stack (;)



          7) sdsdfsdfsdfsdfsdfsdfsdfsdfsdfsdfs; is executed, which likely throws an error (it's too long to be a variable name but could be part of a valid %let statement);







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 20 '18 at 11:28









          Allan BoweAllan Bowe

          8,1601554104




          8,1601554104













          • yes i see that now, thanks. when i added a semi colon after my nonsense string SAS returned an error code of 3000...my test case for an error is unlikely to happen when my code gets to a batch state as finger trouble such as missing semi colons will have been ironed out whilst developing the code interactively...

            – gdogg371
            Nov 20 '18 at 11:56



















          • yes i see that now, thanks. when i added a semi colon after my nonsense string SAS returned an error code of 3000...my test case for an error is unlikely to happen when my code gets to a batch state as finger trouble such as missing semi colons will have been ironed out whilst developing the code interactively...

            – gdogg371
            Nov 20 '18 at 11:56

















          yes i see that now, thanks. when i added a semi colon after my nonsense string SAS returned an error code of 3000...my test case for an error is unlikely to happen when my code gets to a batch state as finger trouble such as missing semi colons will have been ironed out whilst developing the code interactively...

          – gdogg371
          Nov 20 '18 at 11:56





          yes i see that now, thanks. when i added a semi colon after my nonsense string SAS returned an error code of 3000...my test case for an error is unlikely to happen when my code gets to a batch state as finger trouble such as missing semi colons will have been ironed out whilst developing the code interactively...

          – gdogg371
          Nov 20 '18 at 11:56




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53391488%2fsas-syscc-macro-variable-behaviour%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Tangent Lines Diagram Along Smooth Curve

          Yusuf al-Mu'taman ibn Hud

          Zucchini