What do you feel about hardcoding?

Answer Posted / saurabh gupta

It's a best practice not to hardcode values in code until
or unless it's not very necessary. Always try to use
dynamic variables in your code it will increase the
felxibility of the code.

Ex let say you have to run one of your code every year and
one of your condition needs a date which is begning of the
year and you hardcoded your value like this
%Let YBEG = '2007-01-01'

Then every year when you have to run this code you have to
change the date but if you use daynamic variable it will
resolve automatically.
ex YBEG = Y_BEG_0.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Mention common programming errors committed in sas ?

647


please can you tell me that in companies sas work are doing by through sas coding or sas wizard ??

1661


What is SAS informats?

635


What is the differnce between SDTM 3.1.2 to 3.1.1 version

4609


What is a put statement?

661






What is proc sort?

717


How to create a permanent sas data set?

676


Assuming {et} is randomly drawn from N(0,1) and e0 = 0, generate 200 observations of xt = et − 0.5e(t−1) and draw a line graph of xt.

1460


In sas admin differentiate between roles and capabilities? : sas-grid-administration

556


What are the data types in sas?

606


what are several options for creating reports in web report studio? : Sas-bi

628


what is the primary data source for the wrs? : Sas-bi

657


How do you add a number to a macro variable? : sas-macro

545


Intern stastical programmer written test

288


If you could design your ideal job, what would it look like?

2375