BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Patrick
Opal | Level 21

@Ahsan

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;

http://support.sas.com/kb/24/818.html 

Ahsan
Calcite | Level 5
I try the copy path technique it didn't work I saved in the other path still not working that's strange.
Ahsan
Calcite | Level 5

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;

 

 

Tom
Super User Tom
Super User

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.

Ahsan
Calcite | Level 5
Tom is a txt file file the data set name is excel but it's a txt file format.
ChrisHemedinger
Community Manager

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.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
Ahsan
Calcite | Level 5
Thank you it works perfectly I appreciated all the help

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 21 replies
  • 2376 views
  • 3 likes
  • 6 in conversation