What is the difference between Informatica parameters? - informatica

What is the difference between $myvar and $$myvar parameters in Informatica PowerCenter?

Actually $ means internal Parameter/Variable (such as $DBConnection prefix or $PMSessionLogDir) whereas $$ are used for user-defined parameters or variables (which could be defined at mapping or workflow/worklet level).
You can declare and use variables and parameters starting with $$
You can override and use pre-defined parameters starting with $PM* (i.e. $PMSessionLogDir, $PMWorkflowLogCount)
You can use without declaration parameters following predefined templates (i.e. $InputFile, $DBConnection, etc.).
I hope this all make more sense to you.
Regards,
--
YM

$ means Session Parameter/Session Variable
$$ means Mapping Parameter/Mapping Variable

Related

Is it possible to use two or more different yylex() functions in same C/C++ program? [duplicate]

This question already has answers here:
Is it possible to have two or more Lex/Yacc parsers in the same application
(4 answers)
Closed 7 years ago.
I'm making a lexical analyzer for C language, a less-powered version.
I want to process different kinds of regular expressions at different times for example, for the first time the input character stream from the source program and then the second time, an intermediate representation form of the program generated after first processing.
So is it possible to create 2 or more yylex() functions using FLEX and use it in a same C/C++ program, the lexical analyzer?
You can use the %prefix declaration to change the yy in yylex (and a variety of other global names) to something different, which allows you to have multiple scanners in the same project. You will probably also want to use the -o option to set the name of the generated file; otherwise, the build procedure gets ugly.
But they will be completely separate scanners, each with their own input stream. That might not be what you want.
If you want a scanner whose lexical definitions can be changed to another set, you need to use start conditions. That will let you change scanner behaviour in different contexts, and has the advantage that you can share common lexical features.
flex has a similar parameter:
‘-PPREFIX, --prefix=PREFIX, %option prefix="PREFIX"’changes the
default ‘yy’ prefix used by flex for all globally-visible variable and
function names to instead be ‘PREFIX’. For example, ‘--prefix=foo’
changes the name of yytext to footext. It also changes the name of the
default output file from lex.yy.c to lex.foo.c.
So you can rename the second function and its variables.
Unfortunately POSIX lex has not such parameter.

How do I specify runtime constants in (modern) Fortran?

I'm working on a Fortran 2008 project in which I read some parameters (including both scalars and arrays) from an input file using read statements. I would like to enforce that these parameters not be modified after they are read in. How can I achieve this?
Module variables can be given the PROTECTED attribute, which prevents code USE'ing the relevant module from modifying the module variable through the name of the variable.
However this does not prevent modifications to the variable from within the defining module or its descendant submodules, or modifications to the variable through means other than the use associated name (e.g. through a pointer associated with the same thing), or stop non-conforming Fortran code from modifying the variable (e.g. by the use associated name being used as an actual argument to a procedure with implicit interface that modifies the corresponding dummy).
In fortran 90, You can define a module that has those variables as private member. Let the module define only the function to read your variables from file, and getter functions that return their values. And no other function in the module.
I do not use the OO capability offer by fortran 2003 an fortran 2008, but the scenario will be similar.

Define constant in SQLite C/C++ API

Does the SQLite C/C++ API support a way to define a constant for usage in queries? Something like this:
SELECT user_defined_function(USER_DEFINED_CONSTANT)
where USER_DEFINED_CONSTANT evaluates to some specified value.
You can create a user-defined function that always returns the same value. Alternatively, since you're talking about the C API, you could consider using a variable or a constant at the C level to help create the text of your prepared statements (containing a bona fide SQL literal).
As far as I know or can determine, however, you cannot define a symbol that SQLite will automatically transform to a constant.

Default for optional string option in .ado program

I wrote a .ado program that generates a new variable. I would like to have a
default suffix appended to the new variable, but allow a user-specified
suffix. That is, by default append _tr to the original variable's name, but
allow a user-specified suffix, say _tr1pct.
Is this possible with syntax?
My syntax line is as follows.
syntax varlist [if] [in] ///
[, Byvar(varlist) Tail(real 1) ///
Suffix(string) noRelabel]
And the suffix is applied later in the program as follows.
clonevar `x'_`suffix' = `x' ///
if `thisuse' & inrange(`pct', `tail', 100 - `tail')
I tried Suffix(string tr) and Suffix(string "tr"), but these are syntax
errors. I guess I can't have a default argument to an option (and I can't find
anything about defaults for string options, in any case).
Is there a way to give local macro suffix a default?
Yes. You can declare Suffix(string) as an option and then after syntax go
if "`suffix'" == "" local suffix "_tr"
If the user didn't specify an argument, the local macro suffix will be empty and you define what it should be. That's a default.
I don't know a reason why syntax does not allow this, but I take this to be the standard procedure given that it does not.

isDefined function?

In C++ is there any function that returns "true" when the variable is defined or false in vice versa. Something like this:
bool isDefined(string varName)
{
if (a variable called "varName" is defined)
return true;
else
return false;
}
C++ is not a dynamic language. Which means, that the answer is no. You know this at compile time, not runtime.
There is no such a thing in runtime as it doesn't make sense in a non-dynamic language as C++.
However you can use it inside a sizeof to test if it exists on compile time without side-effects.
(void)sizeof(variable);
That will stop compilation if var doesn't exist.
As already stated, the C++ runtime system does not support the querying of whether or not a variable is declared or not. In general a C++ binary doesn't contain information on variable symbols or their mappings to their location. Technically, this information would be available in a binary compiled with debugging information, and you could certainly query the debugging information to see if a variable name is present at a given location in code, but it would be a dirty hack at best (If you're curious to see what it might look at, I posted a terrible snippet # Call a function named in a string variable in C which calls a C function by a string using the DWARF debugging information. Doing something like this is not advised)
Microsoft has two extensions to C++ named: __if_exists and __if_not_exists. They can be useful in some cases, but they don't take string arguments.
If you really need such a functionality you can add all your variables to a set and then query that set for variable existance.
Already mentioned that C++ doesn't provide such facility.
On the other hand there are cases where the OS implement mechanisms close to isDefined(),
like the GetProcAddress Function, on Windows.
No. It's not like you have a runtime system around C++ which keeps remembers variables with names in some sort of table (meta data) and lets you access a variable through a dynamically generated string. If you want this, you have to build it yourself, for example using a std::map that maps strings to some objects.
Some compile-time mechanism would fit into the language. But I don't think that it would be any useful.
In order to achieve this first you need to implement a dynamic variable handling system, or at least find some on the internet. As previously mentioned the C++ is designed to be a native language so there are no built-in facilities to do this.
What I can suggest for the most easy solution to create a std::map with string keys storing global variables of interest with a boost::any, wxVariant or something similar, and store your variables in this map. You can make your life a bit easier with a little preprocessor directive to define a variables by their name, so you don't need to retype the name of the variable twice. Also, to make life easier I suggest to create a little inline function which access this variable map, and checks if the given string key is contained by the map.
There are implementation such a functionality in many places, the runtime property handling systems are available in different fashion, but if you need just this functionality I suggest to implement by yourself, because most of these solutions are quite general what you probably don't need.
You can make such function, but it wouldn't operate strings. You would have to send variable name. Such a function would try to add 0 to the variable. If it doesn't exists, an error would occur, so you might want to try to make exception handling with try...throw...catch . But because I'm on the phone, I don't know if this wouldn't throw an error anyways when trying to send non-existing variable to the function...