BookmarkSubscribeRSS Feed
TimCampbell
Quartz | Level 8

Hi all,

My next project in SAS will involve setting up some scheduled jobs in DI studio to import some set format text files into SAS from a 'file queue' like setup.

The basic setup will need to be that SAS will

  • check a directory for new files
  • Import the new file whilst checking data etc.
  • Move the imported file to a 'Done' subdirectory if successful

I am fairly confident with how the import and formatting process will need to work and setting up the jobs to run on a regular schedule or even monitor the folder for new files however i am not sure how to get SAS to move the physical text files around once they have been processed.

Has anyone had to do this before or has an idea on what i would need to make this happen?

If it helps, the server that is running the code is Linux.

Thanks in advance,

Tim

1 REPLY 1
ballardw
Super User

You can check directory and file status using the DINFO and FINFO functions and related, see the online help for examples.

The X command in SAS sends sytem commands to the OS such as copying, deleting or moving files. Actually anything you can instruction you can do with a command line can be done with the X command.

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
  • 1 reply
  • 346 views
  • 0 likes
  • 2 in conversation