Desktop productivity for business analysts and programmers

Dynamic selection file

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 7
Accepted Solution

Dynamic selection file

i'm just finished a project (egp) and pretty much is working as we need, now i want to build a GUI interface in order to making more friendly to use

at this moment it works as follow

filename NEW_FILE 'path file\file.txt ';

DATA dataset (drop= variable1 variable5) ;

    LENGTH

        variable1             8

        variable2        $ 50

        variable3        $ 50

        variable4      $ 50

        variable5         $ 50

        variable6            $ 50

    FORMAT

        variable1     DDMMYY10.

        variable2        $CHAR50.

        variable3       $CHAR50.

        variable4      $CHAR50.

        variable5          $CHAR50.

        variable6           $CHAR50.

      

    INFILE NEW_FILE

        DLM=';' DSD ;

.......

......

......

It its possible to get pathfile\file.txt using WINDOWS BROWSER ? (if not we are forcing to rename each file prior to use this sas project)

any ideas?

regards


Accepted Solutions
Solution
‎05-11-2015 03:33 PM
Contributor tlk
Contributor
Posts: 53

Re: Dynamic selection file

Hello,

You have to define a prompt in the prompt manager.  There is a "file or directory" type prompt that will do what you need.   The prompt create a macro variable that you can use in your program.    The macro variable have the same name has your defined prompt.  You have to add your prompt in the program properties.

View solution in original post


All Replies
Solution
‎05-11-2015 03:33 PM
Contributor tlk
Contributor
Posts: 53

Re: Dynamic selection file

Hello,

You have to define a prompt in the prompt manager.  There is a "file or directory" type prompt that will do what you need.   The prompt create a macro variable that you can use in your program.    The macro variable have the same name has your defined prompt.  You have to add your prompt in the program properties.

Occasional Contributor
Posts: 7

Re: Dynamic selection file

seems to be the right way to solve this problem but still missing something.

once i add the prompt to program properties, indeed program ask for the file , but is unable to import any data

"ERROR: No logical assign for filename NEW_FILE "

prompt is with variable name NEW_FILE and program is

filename NEW_FILE ;

data step.....

length.....

format......

.....

.....

    INFILE NEW_FILE

        DLM=';' DSD ;

what am i missing here?

Occasional Contributor
Posts: 7

Re: Dynamic selection file

seems to be the right way to solve this problem but still missing something.

once i add the prompt to program properties, indeed program ask for the file , but is unable to import any data

"ERROR: No logical assign for filename NEW_FILE "

prompt is with variable name NEW_FILE and program is

filename NEW_FILE ;

data step.....

length.....

format......

.....

.....

    INFILE NEW_FILE

        DLM=';' DSD ;

what am i missing here?

Occasional Contributor
Posts: 7

Re: Dynamic selection file

i'm realize how configure the macro varible in infile statment.

infile "&NEW_FILE"

regards,

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 487 views
  • 1 like
  • 2 in conversation