I want to modify a name of a column, for instance from "2nd_Row" to "_2nd_Row", I tried to use the 'Rename' option, but is not working.
Can I do it into a SAS Program, or should I do it manually?
Thank you!
Look at the documentation for name-literial.
rename '2nd_row'n = _2nd_row;
Related
Assume that I have a SAS script file named "my_sas_script.sas". I want to add statements to that script so as to achieve the following:
When the script is executed a variable should be created and the value of that variable should be "my_sas_script.sas". The variable type should preferably be character but the name of the variable is immaterial.
The purpose is to give names to output files which are similar to the name of the script without being forced to adapt the code whenever the name of the script is changed.
If you are running your SAS program from the command line:
sas my_sas_program.sas
Then you can just use the value of the SYSIN option.
%let program=%qsysfunc(getoption(sysin));
If you want to remove any path to the file that might be included use %SCAN().
%let program=%qscan(&program,-1,/\);
I want to print same TIMESTAMP(session start time) for all the records in Target table using mapping parameter and variable option.
Can you please help me to solve this?
You can use SESSIONSTARTTIME build-in variable for that purpose.
I'm trying to use a 2 workflows to archive any files when created or updated. The first simply moves a copy to a separate doc library. no issues
The second should rename the file once it arrives to append a date (and possible timestamp) to the end of the file so that it is a unique record.
I am trying to set a variable called Archive_Name and then setting the field value to the Archive_Name before commiting the change.
I am using this fomula to set the variable
Name-fn-FormatDate(Current Date,yyyy-MM-dd)
Both Name and Current Date are recognised variable.
When I run this the Name stays the same and does not append a date. If I run it as
fn-FormatDate(Current Date,yyyy-MM-dd)
the Name changes to my desired date proving that the formula is working, the text is being assigned to the Archive_Date variable and the variable is being applied to the field value.
What am I doing wrong?
I believe you need to concatenate the two variables. The & operator can be used in place of the CONCATENATE function. Thus; Name&fn-FormatDate(Current Date,yyyy-MM-dd)
Hope this helps
I want to customize the template for every single dataset, using the dataset name for sharing button.
Is there a variable to get the dataset name?
Thanks
It sometimes varies depending on what page's template you're editing, but a lot of the time one of c.pkg.name, c.pkg_dict.name, pkg.name or pkg_dict.name should work.
To find out how to see for sure exactly what variables are available to each template, read http://docs.ckan.org/en/latest/theming/variables-and-functions.html
I'd like to get a list/array of a record object's column names. I suppose I could get this by looping thru the method names, but I was hoping that there would be something cleaner?
Use _getObjectMetadata().getFields() to get all of the fields on a Reactor object :)