Sas move dos files




















Remember, any environment variables you define are not available to SAS. The X command is a global SAS statement; therefore, it is important to realize that you cannot conditionally execute the X command. For example, if you submit the following code, the X statement is executed:.

This example uses the value of the variable FLAG to conditionally create folders. This option and its negative form operate in the following ways:. This is the default value. You do not have to type EXIT. When a window created by an X statement is active, reactivating SAS without exiting from the command processor causes SAS to issue a message box containing the following message:. That is, control is not returned to SAS until the command has completed.

This is the default. That is, control is returned immediately to SAS and the command continues executing without interfering with your SAS session. What benefit is there in programming this? Thank you for the proposed solution but that's not really what I'm after as it still executes a separate data step per file. Below is real code which I've run in my environment - with two files in sourcedir file1. For some reason I don't understand the first code execution only moved file1. I'm getting files delivered from an upstream process dumped into a folder and I'm also getting metadata for these files inserted into an Oracle table.

I need to create a directory listing of the files, inner join it with the metadata and then only process the files which exist both in metadata and on the file system. My process will execute in mini-batches and I can't be sure that metadata and files in the directory are always in sync that's why I need the inner join. If I find information in both places then I can process the files move them to a process folder for the next step. Calling all SAS users! We now have even more FREE knowledge journeys.

Learn more. Choose Your Journey. IF, SQL vs. Sign In. Turn on suggestions. Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for. Search instead for. Chris, Yes,I am referring to the 4. My colleagues meet the same issues. Do you have any suggestions? By the way,I'm from Shanghai,and my English is not good,and expression may be not clear or syntax error. If you think my expression is not clear,please let me know. Thanks very much. I understand the problem It's possible that the path you are specifying is different from the SAS file system. That is, the path might need to be expressed differently.

If that works, then SAS sees the path as valid and accessible. If not, then it's possible you need to supply a more complete path in order for SAS to resolve it. It does work. Is it that it did not resolve numbers?? Oh,I'll test it tomorrow. Okay, remember these limitations: - the wildcard notation is only on the file name, not the folder names. The task won't resolve wildcards in folder names. It operates only on the one named folder path. Chris, This is not the problem of path.

It may be the server. Thanks very much for your advice. Chris: I'm having the same trouble as a few folks here but lack their. To sum up : 1 I get the following error when trying to load custom tasks : "Unable to load file Error: Could not load file or assembly 'SAS.

ProjectReviewer' or one of its dependencies. Operation is not supported. The problem is I don't know where to do that. It could be that I set it in the wrong place.

Roberto, check the "Special steps for running task examples" section on this page with some of my examples. Ensure that the DLL file is "Unblocked" on your system, per these instructions. If that doesn't solve the issue, post back and I'll look into it some more. This was a major problem until I stumbled upon The Dummy Blog and found this handy add-in. Thanks for sharing it.

Thanks for this! I found it yesterday and am using it in conjunction with a web service. Tom, great to hear it! Is there a registry change that has to be made or is there a setting within EG itself that can be altered to override the original location of the DLL? Check the "Special steps for running task examples" section on this page with some of my examples. Hi Chris, I have problems installing this add-on on my EG 4. Error: Add-In is invalid file type. It doesn't make any difference that i unblock the files.

Hope you have some suggestions because I really need the Add-In feature Maybe you transcribed the message incorrectly in the comment, but just want to make sure. You can capture a few more diagnostics by turning on logging using the instructions in this SAS Note. If you capture the log while you see the "add-in" error message, there should be some additional entries in the log around SAS.

If you post those back or e-mail to chris. You are ofcause right that I transcripted the message incorrectly, the file name is "SAS. AddInRegistry [ null ] - Type OptionsTask failed inspection as a custom task: Exception has been thrown by the target of an invocation.

AddInRegistry [ null ] - Type MacroTask failed inspection as a custom task: Exception has been thrown by the target of an invocation. Exception: Add-In is an invalid file type. Any suggestions? By default, The. Alternatively, you can enable the Code Access Security by adding your network location as a Full Trust location.

To do this, you launch ". NET Framework 2. Search for "Microsoft. NET code access security" for more background and instructions for the tool. Also We are planning to migrate on EG5. Could you please help? Sorry, I don't have a 4. If you're planning to move to 5. Regarding migrating to Citrix: if you run via Citrix or Terminal Server, your EG session is on a remote Windows environment that you log into.

It won't be on your local machine. Thus, a tool like Copy Files if that's what you're trying to use has to be installed on the Citrix environment as well. You'll need to ask your IT support staff to help make that happen. Thank you! This is great! I look forward to integrating all of those repetitive file transfers right into my Process Flow! Hi Chris, First of all thank you for this lovely little peice of work. If you or anyone can shed some light on what is this error, it would be great.

Thanks in advance! Do you have the most recent version of the task? This type of path would work only after getting the version I posted last week. Any easy way to tell if you have the latest: the updated version also has a Save button on the bottom, whereas the earlier version did not had only a Run button, plus Cancel and Help.

Thanks for the prompt reply Chris. I used the new version after I saw your comment but still no success. I am also having problems running the EG Scheduler and sas support said it will give you a problem if you are working in client-server environment.

If you can direct me to some material that I can refer to for this problems, I would appreciate it. Thanks for your help! Amey, another thing to check is that you can actually reach the path you supplied via a SAS program on this workspace. The path you supplied might not be a good reference in terms of the SAS Workspace environment.

I was able to use this program sucessfully to move. However, I was not able to move. The log said that the files were moved it showed the bytes moved but on the linux box the files showed up as 0 bytes. Is it possible to use this for. If you continue to have troubles, respond back and I'll help you to diagnose it. I'm also having trouble registering the Add-in. CopyFiles51' or one of its dependencies.

What am I doing wrong? It might be that you don't have the "unblock" permissions necessary -- your error message is definitely consistent with the "blocked DLL" situation. See my update in this post for "special steps". Thanks for your help. Our Help desk managed to unblock the file for me - I didn't have the necessary permissions. I need to read multiple files that have header and footer records, and I don't see options for this in the GUI.

Todd, since your file name has mixed-case naming, make sure that the file exists on your UNIX path with that name exactly. UNIX is case-sensitive about file names. You're correct that if you want a process that reads multiple files as a collection, you will need to use a SAS program and not the Import Data task that EG provides -- although that might help you get started.

Hi Chris- This is excellent I was trolling around looking for info on how to build custom tasks and stumbled into this task which we've been trying to build work arounds for for a few months. I appreciate you posting! Brendan, I'm glad you like it. For the latest information about building your own tasks, start at this support page. Hi Chris, great utility!

I was successful getting this to work on my local PC to copy files from a mapped drive to the SAS server when I use the Mapped drive notation, i. However, our setup for users runs from TSX servers. I have access to log onto the TSX servers and can see my mapped drives from there so would assume this would work. However, I get the following when running the task from a TSX server, and seems that it is done processing?

I'm not familiar with TSX servers but I'm going to guess that this is a way to publish an app "virtually" so that you can use it without installing the app on your local PC.

Is that correct? Here are some things to check: If you downloaded this task before 16May, be sure that you have the most recent version. I posted a new version with some related fixes during May. Make sure that EG can see the mapped drive. Otherwise you'll have to specify a subfolder path for each specific location.

When i run the process flow all queries, program code within process flow the taks simple doesn't work. The log is following:. NOTE: Resolving macro expressions in file paths. I have managed to get this working on my PC but when running the process flow via a stored process route it doesn't export to my local drive.

Is there a workaround for this at all? It's using EG as the mechanism to download the file. To work in a stored process, you need the file copy to happen within the SAS code.

You can accomplish this by setting the output file location to a place that it accessible from both your server and PC a shared network drive, for example.

This SAS Note has an example. I downloaded it today and it worked great out of the box. Simple installation.

The wildcard and macro integration is a great aspect. This add-in has been terrific working with EG and Unix servers. That's a great example of a combination of SAS functions, macros, and the custom task all working for you. Thanks for the sharing your experience! That might explain why some macro variables you assigned in one step were not available in another step -- if they were defined using a different grid node.

Not sure why it can't resolve all the macros in the box, but building the macro in the program as one string worked gary. Chris, also i'm attempting to use the Prompt manager and let the user enter the paths for both as well as some other information. But the macro vars generated in by the Prompts don't resovle for the Copy even though it appears that the Prompt window info is entered before the copy takes place.

Is there a timing macro issue with Prompts? Make sure that when you define your prompt, you check the box "Use prompt value throughout project". See the answer in this communities. Chris, I've copied the. Dennis, check out the "unblock" steps in this blog post. Dear Sir: User your Copy Task. I can copy from local disk to local disk. I wish to copy excel file from http. How do I to set Path? You can achieve this with a two-step approach. I use EG 5.

I am having a problem with the syntax now but believe that I can work that out. Tom, yes, this is definitely possible. How do I use this to copy sources files which are dynamically generated? I have a sas script that generates an excel file with dynamic name, the dynamic part being todays date.

In this case how do I specify the source location? There's an example with a date stamp on the file name. However now I am trying to go further in this process. Is it possible to call this task in a sas program. Because I have a sas script that spits out multiple files on the sas server. Now I want to copy all of those files in other server. Is it possible to do this by inserting the copy task into the sas script? No SAS programs are used for that. If your SAS session can "reach" the target file destination over the network, then you can use SAS code to complete the file copy.

I've shared an example SAS macro for this here. It is wonderful being able to code like I was using base again. Cant believe EG doesnt enable it automatically given it is solved via a few lines of code. Yes that is a fair point! Having said that the above plug-in is also tough in some instances to get added to VDI or other virtual desktop applications.

Hoping it is formally added to EG releases for the future as it is a great bit of kit. Hi, Chris! Can I get the source code of this task? I'm really need it. I'm working on a task which need to upload file from EG to the remote server. I can't provide the source as-is because it makes use of some undocumented APIs. But, you can accomplish a similar operation in a.

Server class. I hope that it works for you -- please let me know if you have any troubles with it. Is there a plain and simple sample program showing moving flat csv files from C: windows platform to SAS Server? You might need a network share location to make that connection. If you don't have a direct network connection outside of SAS Enterprise Guide, then you can use the Copy Files task and a technique such as this one , which combines SAS programming and the custom task that copies files for you.

Hi Chris, I'm using EG 5. The tasks ends with no errors I'm including the log but if I open the table from the server it gives the error "SAS Enterprise Guide cannot opern the data file:xxx Error opening data xxx [Error] The file xxx. DATA doesn't exist". NOTE: Total number of files processed: 1. First, it's unusual to have a folder name with spaces on a Unix server. It is supported, but referencing such folders can be tricky. Unix file names are also case-sensitive, so convention is to stick to lower-case when you can.

The file you're uploading needs to be a valid SAS data set that can be read in the Unix session encoding. Usually it's not a problem as sas7bdat formats can be read by all SAS sessions regardless of operating system , but you might want to test with some code like this:.

Hi Chris, I finally solved it. I don't why but it only worked when I put a wildcard character a question mark? Otherwise it didn't upload the file or rewrite it if it existed. Many thanks anyway. This task works perfect when I run it individually, or as park of a linked chain of many Copy File tasks without any forks. But if the tasks are linked at some point in a forked chain, then the tasks do not run completely. This program is linked to 3 different Copy File tasks, each of which is linked to further Copy file tasks and programs.

Choosing "Run Branch SAS log:. I haven't seen this behavior elsewhere, so I think it's something specific to this task. Any help would be appreciated. Glad you're making use of the task. If you can turn on the additional logging see this note and then send me the resulting log file, I might be able to see what's going on. It could be a weird timing issue or a race condition, as the resolving of the macro variables happens in the background just before the task is run.

You can send the log to me at chris. It will still come to me, as I'm the one who supports this task. This is strange. On alternative days, I am not able to work on this addin. The 'Customs' folder where the dll is stored appears today, but is not seen tomorrow. But again the day after tomorrow it is seen. Would you be knowing why is this happening? When the Customs folder is not seen, a different icon is seen for the addin and I will not be able to work with the addin.

Wow, I have no idea. Are you logging into a system that has a roaming Windows profile that might be different on alternative days? You could enable logging use these instructions on the days where it's NOT working and send me the logging text file chris. Actually, if you do that, send me a log from a day where it IS working as well -- so that we can compare. There is no maximum that I'm aware of. Files are copied in chunks, so memory limitations aren't an issue.

But the destination folder must have enough space to hold the file you're copying. And the larger the file, the longer the file transfer process will take to complete. Chris, We are in the process of converting all the pc based sas users to 9. One of my users is used to loading, massaging,extracting a sas dataset which EG doen't do, so I'm trying your utility. I am the SAS Admin and have admin rights on my box. I've downloaded SAS. CopyFiles71' or one of its dependencies.

I just realized that I'm testing the 7. I went back to the 7. I will start testing it now. Which leads to the question will a 7. Thanks for all you work on the behalf of all of us out here in the field. Sometimes when this happens, it's because the DLL isn't loading from the place you think it is.

Near the beginning of the file, you'll find some mention of the SAS.



0コメント

  • 1000 / 1000