what's wrong with this program?

Reply
Occasional Contributor
Posts: 5

what's wrong with this program?

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

Super User
Super User
Posts: 6,502

Re: what's wrong with this program?

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?

Occasional Contributor
Posts: 5

what's wrong with this program?

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.

Respected Advisor
Posts: 3,900

what's wrong with this program?

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

Occasional Contributor
Posts: 5

what's wrong with this program?

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;

Super User
Super User
Posts: 6,502

what's wrong with this program?

How is this different than just coding.

Pushbutton1:

submit;    

  %include 'F:\w1.sas';

endsubmit;                                                                          

return;

Occasional Contributor
Posts: 5

what's wrong with this program?

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!

Occasional Contributor
Posts: 5

what's wrong with this program?

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

Ask a Question
Discussion stats
  • 7 replies
  • 256 views
  • 6 likes
  • 3 in conversation