Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dragging a file from SAS Content into a SAS program should result in a filename statement for easy programmatic access #329

Closed
clangsmith opened this issue Jun 9, 2023 · 0 comments · Fixed by #510
Assignees

Comments

@clangsmith
Copy link
Contributor

clangsmith commented Jun 9, 2023

Requested/suggested by @boemska-nik, and I really like the idea!

Is your feature request related to a problem? Please describe.
No, it would just be a nice additional convenience feature. Rather than having to remember the syntax to reference a file in SAS Content and type a full filename statement, it would be convenient to be able to just drag the file into a SAS program and have the syntax automatically inserted.

Describe the solution you'd like
Similar to the way you can currently drag a table from the Libraries pane into a SAS program and it results in "library.member" text being inserted into the program (to easily reference that table programmatically), it would be nice/convenient to be able to drag any file from the Explorer pane (SAS Content) into a SAS program and for that to result (when dropped) in filename statement code (with FILESRVC access method, since Files Service) being inserted in the SAS program at the spot it was dropped.

To verify:

  • Run the following SAS code in VS Code to create a sample .csv in your deployment:
    /* Write SASHELP.CLASS to a .csv in SAS Content */ filename dest filesrvc folderpath='/Public/' filename='blah.csv'; proc export data=sashelp.class dbms=csv file=dest; run;
  • In the Explorer pane, click the Refresh icon an confirm the file blah.csv appears in the SAS Content\Public folder.
  • Then, copy this code into a new SAS program:
    data _null_; infile myfile; input; put _infile_; run;
  • Drag the blah.csv file from Explorer pane and drop it on the top line of the SAS program in the previous step.
  • Ensure a filename statement similar to the following is inserted at that spot in the SAS program, where the folderpath corresponds to the folder location of the file and the filename corresponds to the name of the file:
    filename myfile filesrvc folderpath='/Public/' filename='blah.csv';
  • Run the program to make sure it runs successfully. (The contents of the .csv should be printed to the log in this case.)

Describe alternatives you've considered
Users can just continue typing the whole thing out themselves and have to remember the syntax.

Additional context
It would be nice for dragging a library from Libraries pane to result in "< library >" being inserted into the code as well, but we can track that separately.

Environment
Anywhere the Explorer pane (SAS Content, aka Files Service) is supported -- currently Viya 4 and Viya 3.5

@scottdover scottdover linked a pull request Sep 14, 2023 that will close this issue
5 tasks
scottdover added a commit that referenced this issue Oct 17, 2023
**Summary**
This adds the ability to drag sas content into sas programs. See #329 for more details

**Testing**
 - [x] Tested dragging a folder into a SAS program (should not provide any code)
 - [x] Tested dragging a file into a SAS program from my folder
 - [x] Tested dragging a file into a SAS program from my favorites
 - [x] Tested dragging files into a SAS program from nested folder paths
 - [x] Tested dragging two files from the same folder into a SAS program
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants