The following code will write mapped drives to the log as seen by the SAS server. That's what's available to your SAS program.
filename diskinfo DRIVEMAP;
data _null_;
infile diskinfo;
input;
put _infile_;
run;
the sas file in on server and we using import function and it produces this code. In this code infile statement is used if I like to input new file using this code and change the file name in the infile statement can I do this.
DATA WORK.OIA_GL_DET_LEDGER_DAPG67_EXCEL;
LENGTH
'EFF DTE'n 8
COMP 8
ACCOUNT 8
'ACCOUNT DESCRIPTION'n $ 24
CENTER 8
'DOC ID'n $ 12
LINE 8
'INV.DTE'n 8
ENTY $ 4
'TXN DESCRIPTION'n $ 21
'CHECK NUM'n 8
'CTRL D GRP'n 8
AMOUNT 8
SY $ 2
'VENDOR N.'n 8
GR 8
BUYR $ 4
'PO NUMBER'n $ 10 ;
FORMAT
'EFF DTE'n MMDDYY10.
COMP BEST4.
ACCOUNT BEST6.
'ACCOUNT DESCRIPTION'n $CHAR24.
CENTER BEST8.
'DOC ID'n $CHAR12.
LINE BEST4.
'INV.DTE'n MMDDYY10.
ENTY $CHAR4.
'TXN DESCRIPTION'n $CHAR21.
'CHECK NUM'n BEST11.
'CTRL D GRP'n BEST11.
AMOUNT BEST5.
SY $CHAR2.
'VENDOR N.'n BEST9.
GR BEST2.
BUYR $CHAR4.
'PO NUMBER'n $CHAR10. ;
INFORMAT
'EFF DTE'n MMDDYY10.
COMP BEST4.
ACCOUNT BEST6.
'ACCOUNT DESCRIPTION'n $CHAR24.
CENTER BEST8.
'DOC ID'n $CHAR12.
LINE BEST4.
'INV.DTE'n MMDDYY10.
ENTY $CHAR4.
'TXN DESCRIPTION'n $CHAR21.
'CHECK NUM'n BEST11.
'CTRL D GRP'n BEST11.
AMOUNT BEST5.
SY $CHAR2.
'VENDOR N.'n BEST9.
GR BEST2.
BUYR $CHAR4.
'PO NUMBER'n $CHAR10. ;
INFILE '/sas/saswork/SAS_work309F00009EC8_trvlapp1981/#LN00014'
LRECL=170
ENCODING="LATIN1"
TERMSTR=CRLF
DLM='7F'x
MISSOVER
DSD ;
INPUT
'EFF DTE'n : ?? MMDDYY8.
COMP : ?? BEST4.
ACCOUNT : ?? BEST6.
'ACCOUNT DESCRIPTION'n : $CHAR24.
CENTER : ?? BEST8.
'DOC ID'n : $CHAR12.
LINE : ?? BEST4.
'INV.DTE'n : ?? MMDDYY8.
ENTY : $CHAR4.
'TXN DESCRIPTION'n : $CHAR21.
'CHECK NUM'n : ?? BEST11.
'CTRL D GRP'n : ?? BEST11.
AMOUNT : ?? COMMA5.
SY : $CHAR2.
'VENDOR N.'n : ?? BEST9.
GR : ?? BEST2.
BUYR : $CHAR4.
'PO NUMBER'n : $CHAR10. ;
RUN;
In general YES. If you have a working data step, even one as ugly as the thing that EG generated for you, you can point it at a file with a similar structure and use it to create a dataset.
But the problem is that your current code was most likely created o read a text file that Enterprise Guide generated from a Excel spreadsheet. So if you have another Excel SpreadSheet you would need to perform the same types of modifications that EG did to create a similar delimited text file that the SAS dataset expects to read. There is no way that I know to perform just the Excel to text file step of EG. Certainly you cannot do it the non-windows server where your SAS session is running.
The one other caveat: Did EG transform your file at all before it uploaded it?
Background info in this article -- why it happens and how to make EG skip that step, which would be important for repeatability of your program.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.