Subscribe Bookmark RSS Feed

How do I populate contents of a table script with an external jsl file

jeff3928

Community Trekker

Joined:

Jun 29, 2012

I'm trying to write code which will create a new script in an existing data table and populate that script with the contents of another jsl file. For example:

dt<<new table script("script 2"),

     include("filepath\script2.jsl");

);

This code creates a new table script that when run parses and executes the script2.jsl file. What I need is a way to copy the contents of that jsl file into the "script 2" table script at the time the new table script is created, rather than just creating a static reference to the file (which in my case is subject to change).

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

I was able to come up with a solution afer modifying some code found in this message:  https://communities.sas.com/message/107847#107847

script2=char(include("script 2.jsl",<<parse only));

Eval(Parse(Eval Insert( "\[current data table() << New Script( "Script 2", ^script2^)]\")));

1 REPLY
Solution

I was able to come up with a solution afer modifying some code found in this message:  https://communities.sas.com/message/107847#107847

script2=char(include("script 2.jsl",<<parse only));

Eval(Parse(Eval Insert( "\[current data table() << New Script( "Script 2", ^script2^)]\")));