sas, error messages, fdelete, delete xlsx file
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
add a comment |
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
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
add a comment |
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
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
sas
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
add a comment |
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
add a comment |
2 Answers
2
active
oldest
votes
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;
add a comment |
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";
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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;
add a comment |
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;
add a comment |
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;
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;
answered Nov 13 '18 at 16:08
ReezaReeza
13.1k21226
13.1k21226
add a comment |
add a comment |
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";
add a comment |
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";
add a comment |
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";
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";
answered Nov 13 '18 at 14:47
coder1167coder1167
1037
1037
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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