sas, error messages, fdelete, delete xlsx file










0















I am trying to delete an XLSX file on the unix server and getting error messages. Below is my code. How can I delete this file in SAS EG? I need code to do this. Below are the error messages that I am getting.



filename myfile "/server/department/users/id/test/POP_ID.xlsx";
data _null_;
rc=fdelete("myfile");
run;
filename myfileclear;




ERROR: Invalid logical name.
ERROR: Error in the FILENAME statement.









share|improve this question
























  • Good practice is to serve the file read-only through a web service download. That way you can replace it (delete/recreate) without worrying about file locks, as could happen if file opened by Excel from a network share.

    – Richard
    Nov 13 '18 at 16:59















0















I am trying to delete an XLSX file on the unix server and getting error messages. Below is my code. How can I delete this file in SAS EG? I need code to do this. Below are the error messages that I am getting.



filename myfile "/server/department/users/id/test/POP_ID.xlsx";
data _null_;
rc=fdelete("myfile");
run;
filename myfileclear;




ERROR: Invalid logical name.
ERROR: Error in the FILENAME statement.









share|improve this question
























  • Good practice is to serve the file read-only through a web service download. That way you can replace it (delete/recreate) without worrying about file locks, as could happen if file opened by Excel from a network share.

    – Richard
    Nov 13 '18 at 16:59













0












0








0


1






I am trying to delete an XLSX file on the unix server and getting error messages. Below is my code. How can I delete this file in SAS EG? I need code to do this. Below are the error messages that I am getting.



filename myfile "/server/department/users/id/test/POP_ID.xlsx";
data _null_;
rc=fdelete("myfile");
run;
filename myfileclear;




ERROR: Invalid logical name.
ERROR: Error in the FILENAME statement.









share|improve this question
















I am trying to delete an XLSX file on the unix server and getting error messages. Below is my code. How can I delete this file in SAS EG? I need code to do this. Below are the error messages that I am getting.



filename myfile "/server/department/users/id/test/POP_ID.xlsx";
data _null_;
rc=fdelete("myfile");
run;
filename myfileclear;




ERROR: Invalid logical name.
ERROR: Error in the FILENAME statement.






sas






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 13 '18 at 14:27







coder1167

















asked Nov 13 '18 at 14:21









coder1167coder1167

1037




1037












  • Good practice is to serve the file read-only through a web service download. That way you can replace it (delete/recreate) without worrying about file locks, as could happen if file opened by Excel from a network share.

    – Richard
    Nov 13 '18 at 16:59

















  • Good practice is to serve the file read-only through a web service download. That way you can replace it (delete/recreate) without worrying about file locks, as could happen if file opened by Excel from a network share.

    – Richard
    Nov 13 '18 at 16:59
















Good practice is to serve the file read-only through a web service download. That way you can replace it (delete/recreate) without worrying about file locks, as could happen if file opened by Excel from a network share.

– Richard
Nov 13 '18 at 16:59





Good practice is to serve the file read-only through a web service download. That way you can replace it (delete/recreate) without worrying about file locks, as could happen if file opened by Excel from a network share.

– Richard
Nov 13 '18 at 16:59












2 Answers
2






active

oldest

votes


















3














I believe the error relates to your last filename statement, where the ref is longer than 8 chars and the clear runs into the filename. I suspect if you add a space it will be fine.



filename myfileclear;


Should be:



filename myfile clear;





share|improve this answer






























    0














    This worked for me. I deleted filename myfileclear;.



    %let outdir=/server/department/users/id/test;
    filename myfile "&outdir/POP_ID.xlsx";
    data _null_;
    rc=fdelete("myfile");
    run;
    proc export DATA=OUT1.POP_ID_5C
    OUTFILE= "&outdir/POP_ID.xlsx"
    DBMS=xlsx REPLACE ;
    SHEET = "POP_ID";
    proc export DATA=OUT1.REQ_1_4_04T1
    OUTFILE= "&outdir/POP_ID.xlsx"
    DBMS=xlsx REPLACE ;
    SHEET = "REQ_1_4";





    share|improve this answer






















      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%2f53283115%2fsas-error-messages-fdelete-delete-xlsx-file%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      3














      I believe the error relates to your last filename statement, where the ref is longer than 8 chars and the clear runs into the filename. I suspect if you add a space it will be fine.



      filename myfileclear;


      Should be:



      filename myfile clear;





      share|improve this answer



























        3














        I believe the error relates to your last filename statement, where the ref is longer than 8 chars and the clear runs into the filename. I suspect if you add a space it will be fine.



        filename myfileclear;


        Should be:



        filename myfile clear;





        share|improve this answer

























          3












          3








          3







          I believe the error relates to your last filename statement, where the ref is longer than 8 chars and the clear runs into the filename. I suspect if you add a space it will be fine.



          filename myfileclear;


          Should be:



          filename myfile clear;





          share|improve this answer













          I believe the error relates to your last filename statement, where the ref is longer than 8 chars and the clear runs into the filename. I suspect if you add a space it will be fine.



          filename myfileclear;


          Should be:



          filename myfile clear;






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 13 '18 at 16:08









          ReezaReeza

          13.1k21226




          13.1k21226























              0














              This worked for me. I deleted filename myfileclear;.



              %let outdir=/server/department/users/id/test;
              filename myfile "&outdir/POP_ID.xlsx";
              data _null_;
              rc=fdelete("myfile");
              run;
              proc export DATA=OUT1.POP_ID_5C
              OUTFILE= "&outdir/POP_ID.xlsx"
              DBMS=xlsx REPLACE ;
              SHEET = "POP_ID";
              proc export DATA=OUT1.REQ_1_4_04T1
              OUTFILE= "&outdir/POP_ID.xlsx"
              DBMS=xlsx REPLACE ;
              SHEET = "REQ_1_4";





              share|improve this answer



























                0














                This worked for me. I deleted filename myfileclear;.



                %let outdir=/server/department/users/id/test;
                filename myfile "&outdir/POP_ID.xlsx";
                data _null_;
                rc=fdelete("myfile");
                run;
                proc export DATA=OUT1.POP_ID_5C
                OUTFILE= "&outdir/POP_ID.xlsx"
                DBMS=xlsx REPLACE ;
                SHEET = "POP_ID";
                proc export DATA=OUT1.REQ_1_4_04T1
                OUTFILE= "&outdir/POP_ID.xlsx"
                DBMS=xlsx REPLACE ;
                SHEET = "REQ_1_4";





                share|improve this answer

























                  0












                  0








                  0







                  This worked for me. I deleted filename myfileclear;.



                  %let outdir=/server/department/users/id/test;
                  filename myfile "&outdir/POP_ID.xlsx";
                  data _null_;
                  rc=fdelete("myfile");
                  run;
                  proc export DATA=OUT1.POP_ID_5C
                  OUTFILE= "&outdir/POP_ID.xlsx"
                  DBMS=xlsx REPLACE ;
                  SHEET = "POP_ID";
                  proc export DATA=OUT1.REQ_1_4_04T1
                  OUTFILE= "&outdir/POP_ID.xlsx"
                  DBMS=xlsx REPLACE ;
                  SHEET = "REQ_1_4";





                  share|improve this answer













                  This worked for me. I deleted filename myfileclear;.



                  %let outdir=/server/department/users/id/test;
                  filename myfile "&outdir/POP_ID.xlsx";
                  data _null_;
                  rc=fdelete("myfile");
                  run;
                  proc export DATA=OUT1.POP_ID_5C
                  OUTFILE= "&outdir/POP_ID.xlsx"
                  DBMS=xlsx REPLACE ;
                  SHEET = "POP_ID";
                  proc export DATA=OUT1.REQ_1_4_04T1
                  OUTFILE= "&outdir/POP_ID.xlsx"
                  DBMS=xlsx REPLACE ;
                  SHEET = "REQ_1_4";






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 13 '18 at 14:47









                  coder1167coder1167

                  1037




                  1037



























                      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%2f53283115%2fsas-error-messages-fdelete-delete-xlsx-file%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







                      這個網誌中的熱門文章

                      Barbados

                      How to read a connectionString WITH PROVIDER in .NET Core?

                      Node.js Script on GitHub Pages or Amazon S3