I've made a custom task and got it saved as a CTM file. When in edit mode (viewing the XML) I can run it and it creates a CTK which will then work exactly as I want.
If I then save that CTK file as a saved task (either to a folder or my tasks) whilst it will still run at that point if I close the CTK file and then reopen it will no longer run! The run button is disabled and nothing I can do enables it.
The task has one required inputtext control, but that's got data in because it generates the SAS code. It's also got a simple dependency of a number selector that's shown or hidden depending on a radio button choice.
No error message or information is given as to why the task cannot be run
I can only presume this is a bug in Studio (I'm in version 3.6) because I can't see any reason why a task that runs perfectly well in some conditions becomes inoperable.
I just want to distribute the CTK file to my users. I could give them the CTM file which on opening they could choose to just 'run' instead of 'edit' but that's an extra level of action they'll need to perform, needlessly.
Any suggestions?
Managed to figure this out myself.
It's one of two connected things:
1. I had an empty data source tag inside the <DataSources> section in <Metadata>. As the SAS code that the task creates doesn't need a data source this is unnecessary so I removed it.
2. Saving a CTM file as a CTK causes it to insert into the Task template a <TemplateValues version="x.x"> section. That includes JSON data for the default values for the controls and data sources in the task. Making a new task that includes that TemplateValues tag data means a default value for the datasource can be taken out and any default values for controls that are unwanted. They then won't be overwritten when that CTM is saved as a CTK.
Managed to figure this out myself.
It's one of two connected things:
1. I had an empty data source tag inside the <DataSources> section in <Metadata>. As the SAS code that the task creates doesn't need a data source this is unnecessary so I removed it.
2. Saving a CTM file as a CTK causes it to insert into the Task template a <TemplateValues version="x.x"> section. That includes JSON data for the default values for the controls and data sources in the task. Making a new task that includes that TemplateValues tag data means a default value for the datasource can be taken out and any default values for controls that are unwanted. They then won't be overwritten when that CTM is saved as a CTK.
Calling all data scientists and open-source enthusiasts! Want to solve real problems that impact your company or the world? Register to hack by August 31st!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.