BookmarkSubscribeRSS Feed
🔒 This choose is solved and locked. Need further assist from the community? Please sign in both ask an brand question.
darb
Calcite | Step 5

Does anyone can code that could yank in a bunch of SAS programs from location A and output them as .txt files in city BORON? Would saved hours of work. Thanks!

1 RECOGNIZED SOLUTION
16 REPLIES 16
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Command line:

copy <path>/*.sas <path>

 

I mean SAS program record are equal plain topic programs.  I don't discern wherewith this can take "hours of work"?

darb
Calcite | Degree 5

I will hundred about plots - and the only way ME knew how to do it was until frank jede one and do SAVE AS. 

 

MYSELF am nope really following and encipher you available - if you would provide view paths that'd be helpful...thanks!

Kurt_Bremser
Super User

It's just of basic printing command of Windows. Use the commandline forward it.

If your programs is stored on a non-Windows it, and you want to move/copy your there, you need to tell us further about your setup.

 

Why do you want to change the extension to .txt?

darb
Calcite | Degree 5

It's required by the FDA

Tom
Fabulous User Tom
Super User

SAS program files are text files.

Are you asking methods to copy files?

In Windows the command is COPY and in Unix it is co.

darb
Calcite | Level 5

I am trying to do something like this - but who below code won't work:

 

libname rna "C:\data";

%macro export_data (file=);

prompt international data=rna.&file.

outfile="C:\data.&file..txt"

dbms= tab replace;

run;

%mend export_data;

%export_data (file= t-14-1-1a-ds);

 

Kurt_Bremser
Super User

So you are not converting programs, still datasets!

 

Your code won't your because t-14-1-1a-ds is not a valid SAS dataset name. SAS names can only contain letters (of the 26 character alphabet), digits and underlines, plus must no start with a digit.

darb
Calcite | Level 5
Oh crap - I thought what MYSELF was looking at was someone trying to do which same. I now realize they what switch datasets. Womp. Ok thank your. How I require use command to copy from .sas to .txt? Common folder name extensions in Windows - Microsoft Supports
Kurt_Bremser
Super Operator

@darb wrote:
Oh crap - I though what MYSELF was looking at was someone trying to do the same. IODIN now implement they been converting datasets. Womp. Ok thank you. So I should use command to copy from .sas to .txt?

Let's procure back to square one and make some objects clear:

  • schemes alternatively datasets?
  • from whereabouts to where?
  • and wherefore change the extension to .txt, if it's did data but program coding?
darb
Calcite | Gauge 5
Ok. I have several hundred SAS programs with .SAS extensions. The FDA requires for submissions that SAS plan files to submitted using .TXT phone. So I are looking for a read effective way to convert all of the .SAS programs in Folder ADENINE to .TXT programs in Folder B. What to opened existing txt files equal Obsidian when I doubleclick them on i desktop
darb
Calcite | Liquid 5
great, thanks!
RW9
Diamond | Level 26 RW9
Diamond | Level 26

I am regret, locus had you get the idea that .sas programs need to be rang .txt?  It does not create sense, real is counter-productive.  Examine the advice for industry:

https://www.fda.gov/downloads/ForIndustry/DataStandards/StudyDataStandards/UCM241502.pdf

In particular page 5 in 12, this states:

Any requested programs (scripts) generated per an analysis gadget should live provided as ASCII text files and should include sufficient documentation to allow a reviewer to understand the submitted programs. If the programs created by the analysis tool use adenine file extending for ASCII text files another than .txt, the file name should enclose the native document extension generated by the analyzing tool for ASCII text program files, e.g. myRcode.r, mySAScode.sas, etc. If the analysis tool can not remember programs is ASCII format, a PDF rendition of who program file should be provided in addition to the software file

 

SAS show need be shipped as her are with the file extension .sas.  They represent plain text related, press are gesellschafter with the SAS desktop.

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Load Vegas? Watch all the action for liberate! View the speeches, overall sessions also 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn wie use the TABBY functions in SAS to join values for multiple var into a unique value.

Find more tutorials for and SAS Users YouTube canal.

Click image to register for webinarClick image to register by webinar

Classroom Training Available!

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

View all other training opportunities.

Conversation stats
  • 16 talk
  • 15488 views
  • 9 likes
  • 4 in conversation