BookmarkSubscribeRSS Feed
wang226
Calcite | Level 5

I want to call a sas program in a SAS/AF frame, I wrote down a program in SAS/AF:

Pushbutton1:                                                                                                                           

                                                                                                                                       

rc=filename(fname,'F:\w1.sas');                                                                                                        

                                                                                                                                       

rc=preview('include',fname);                                                                                                           

                                                                                                                                       

submit continue;                                                                                                                       

                                                                                                                                       

endsubmit;                                                                                                                             

                                                                                                                                       

return;

But there are some warning in log:

WARNING: [Line 3]  Converting numeric variable fname to character

WARNING: [Line 5]  Converting numeric variable fname to character

WARNING: [Line 5]  Variable rc is defined but not used

WARNING: [Line 5]  Variable fname is uninitialized

NOTE: Code generated for CHESHIDIAOYONG.FRAME. Code size=1010.

I am a beginner.........thanks

7 REPLIES 7
Tom
Super User Tom
Super User

I have only a little experience with SCL programming, but the error message seems to say you need to declare FNAME as character.

Also shouldn't you have same actual code in your submit block?

wang226
Calcite | Level 5

Thanks a lot. but it doesn't work yet after I declare it. the log like this:

NOTE: Compiling CHESHIDIAOYONG.FRAME (SASUSER.EXAMPLE.CHESHIDIAOYONG.SCL).

WARNING: [Line 7]  Variable fname is uninitialized

WARNING: [Line 7]  Variable rc is defined but not used

NOTE: Code generated for CHESHIDIAOYONG.FRAME. Code size=934.

Patrick
Opal | Level 21

I believe you either need to previously define variable fname ( fname='myfile'; ) or put quotes around fname [ rc=filename('fname','F:\w1.sas'); ]

http://support.sas.com/documentation/cdl/en/sclref/59578/HTML/default/viewer.htm#a000144251.htm

wang226
Calcite | Level 5

thanks a lot. it works like this:

Pushbutton1:                                                                                                                           

                                                                                                                                       

submit;                                                                                                                                

                                                                                                                                       

fname='myfile';                                                                                                                        

                                                                                                                                       

rc=filename(fname,'F:\w1.sas');                                                                                                        

                                                                                                                                       

rc=preview('include',fname);                                                                                                           

                                                                                                                                       

submit continue;                                                                                                                       

                                                                                                                                       

endsubmit;                                                                                                                             

                                                                                                                                       

return;

Tom
Super User Tom
Super User

How is this different than just coding.

Pushbutton1:

submit;    

  %include 'F:\w1.sas';

endsubmit;                                                                          

return;

wang226
Calcite | Level 5

I am so confused...If I use such program:

Pushbutton1:

submit;

fname='myfile';

rc=filename(fname,'F:\w1.sas');

rc=preview('include',fname);

submit continue;

endsubmit;

return;

Some times it works, some times it doesn't work.

When I use such program:

Pushbutton1:

submit;

%include 'F:\w1.sas';

endsubmit;

return;

After I press Pushbutton1, the results not been shown, and the results will be shown after I closed the frame. What is wron?

If I want to know whether the 'w1.sas' was finished, what shoud I do?

Thanks a lot!

wang226
Calcite | Level 5

I'm so confused....when I run the programm after several days, it doesn't work! Who can tell me what's wrong????

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 1378 views
  • 6 likes
  • 3 in conversation