BookmarkSubscribeRSS Feed
Sandeep77
Lapis Lazuli | Level 10

Hi Experts,

I am trying to export a file after running my previous codes but I am getting error. Can you please check what is the error in the code? Thanks

proc export data=work.LIMA_Results_for_AAM (drop=icustomerid)
outfile="\\lowell2.local\shares\public\Trace\Trace Integrity Analyst Data\BAU_Processes\SAS\Enhanced TPT\Storage\Ad Hoc\HCE Trace - 27-09-2022\HCE_Trace (LIMA) for AAM &tdate..csv"
dbms=csv replace; 
run;

Error log:

1          ;*';*";*/;quit;run;
2          OPTIONS PAGENO=MIN;
3          %LET _CLIENTTASKLABEL='LIMA Results';
4          %LET _CLIENTPROCESSFLOWNAME='LIMA Trace';
5          %LET _CLIENTPROJECTPATH='S:\Trace\Trace Integrity Analyst Data\BAU_Processes\SAS\Enhanced TPT\Storage\Ad Hoc\HCE Trace -
5        ! 27-09-2022\HCE Trace Request (LIMA & TPT).egp';
6          %LET _CLIENTPROJECTPATHHOST='LWLT5CG9322XFL';
7          %LET _CLIENTPROJECTNAME='HCE Trace Request (LIMA & TPT).egp';
8          %LET _SASPROGRAMFILE='';
9          %LET _SASPROGRAMFILEHOST='';
10         
11         ODS _ALL_ CLOSE;
12         OPTIONS DEV=SVG;
13         GOPTIONS XPIXELS=0 YPIXELS=0;
14         %macro HTML5AccessibleGraphSupported;
15             %if %_SAS_VERCOMP_FV(9,4,4, 0,0,0) >= 0 %then ACCESSIBLE_GRAPH;
16         %mend;
17         ODS LISTING GPATH=&sasworklocation;
18         FILENAME EGHTML TEMP;
19         ODS HTML5(ID=EGHTML) FILE=EGHTML
20             OPTIONS(BITMAP_MODE='INLINE')
21             %HTML5AccessibleGraphSupported
22             ENCODING='utf-8'
23             STYLE=HTMLBlue
24             NOGTITLE
25             NOGFOOTNOTE
26             GPATH=&sasworklocation
27         ;
NOTE: Writing HTML5(EGHTML) Body file: EGHTML
28         
29         proc export data=work.LIMA_Results_for_AAM (drop=icustomerid)
30         outfile="\\lowell2.local\shares\public\Trace\Trace Integrity Analyst Data\BAU_Processes\SAS\Enhanced TPT\Storage\Ad
30       ! Hoc\HCE Trace - 27-09-2022\HCE_Trace (LIMA) for AAM &tdate..csv"
31         dbms=csv replace;
32         run;

ERROR: The variable icustomerid in the DROP, KEEP, or RENAME list has never been referenced. 
ERROR: Export unsuccessful.  See SAS Log for details.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE EXPORT used (Total process time):
      real time           0.29 seconds
      user cpu time       0.01 seconds
      system cpu time     0.00 seconds
      memory              7680.64k
      OS Memory           35432.00k
      Timestamp           10/04/2022 10:01:16 AM
      Step Count                        22  Switch Count  5
      
33         
34         %LET _CLIENTTASKLABEL=;
35         %LET _CLIENTPROCESSFLOWNAME=;
36         %LET _CLIENTPROJECTPATH=;
37         %LET _CLIENTPROJECTPATHHOST=;
38         %LET _CLIENTPROJECTNAME=;
39         %LET _SASPROGRAMFILE=;
40         %LET _SASPROGRAMFILEHOST=;
41         
42         ;*';*";*/;quit;run;
2                                                          The SAS System                             09:38 Tuesday, October 4, 2022

43         ODS _ALL_ CLOSE;
44         
45         
46         QUIT; RUN;
47         
2 REPLIES 2
Sandeep77
Lapis Lazuli | Level 10
I have removed the drop=icustomerid and it worked. So I think the problem was that the icustomerid was not in the previous table. Is that right?

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 506 views
  • 1 like
  • 2 in conversation