When setting Mapping Variables do you have to wire them all the way to the target? - informatica-powerexchange

I have a confusion on mapping variables in Informatica.
I set the variables using setVariable() and sometimes setCountVariable() but they are still at zero when I try to pass them back to the calling workflow using the postsession-success_variable_assignment.
My question: Can you set a variable anywhere in the mapping and stop there, for example in a expression, or do you have to wire it all the way to the target to get Infa to recognize it?
Can the port be an output only port, or must it be a variable port first and then moved to an output port secondly.

Just output it to next transformation... It will get assigned

Related

Call user defined variable in another variable

Is it possible to call a user defined variable within another user defined variable? For example, in the screenshot below I would like to call the variable 'CmsVersion' value in 'ResultsPath'. Right now it is outputting ${CmsVersion} as the folder name and not the variable value.
You cannot, at least not within the bounds of a single User Defined Variables configuration element.
It is possible if you add another User Defined Variables below your original one, this way you will be able to reference the variables define in the above configuration element in the one(s) which is (are) below:
Demo:
More information: Using User Defined Variables
Variables declared in the same User defined variables config element cannot be reused in the same element. You can move it to Test Plan level as per screenshot below
In your case you will need to do another special handling because you are dealing with a windows folder path. the \ is escape character in JAVA. When you say \${CmsVersion} JAVA is treating \$ as an escape sequence.
I have declared 2 variables CmsVersion correlated within the same config element and CmsVersion1 correlated from Test Plan variable.
Result is as below in Debug Sampler

Does Nifi 1.10 PutSplunk support Expression Language for the Port?

Looking at the documentation for PutSplunk, it says that the Port "Supports Expression Language: true (will be evaluated using variable registry only)", does this mean I can't use expression language? Depending on the data in my flow, I want to have a single PutSplunk processor that handles the different ports I need to send my data to my Splunk instance.
Is there a way around this, because when I use ${splunkPort} in PutSplunk, I receive this error message: NumberFormatException: For input string""
For your convenience, here is the PutSplunk documentation link: https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-splunk-nar/1.10.0/org.apache.nifi.processors.splunk.PutSplunk/
There is a variable registry option in nifi.properties. You can refer a file with this option such as
nifi.variable.registry.properties=test.txt
where the test.txt should have keys and values.
port=1234
url=abc.com
Then, you can refer to the variable port by ${port}.
Supports Expression Language: true (will be evaluated using variable registry only)
There are many types of variables but in this case, the variables from the registry only can be evaluated, that is the meaning.

Assign a string value as a result of a command

I want to put a string result of a command in WinDbg in a variable for a later use.
For example, in a memory breakpointI want to save the result of - lm1ma eip that returns me the current module, for later comparison in $spat command.
If anyone knows a better way to achieve the goal of determining if the current debugged module is a specific module, inside a conditional breakpoint, it could be also helpful.
Use as /c Name CommandString.
It creates an alias to the results of executing the specified command.
https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/as--as--set-alias-

validating ip address in datastage

I have a source file that contains two fields: IP_ADDRESS and USER_NAME. I want to check whether the IP address is correct or not before loading it to the datawarehouse using DATASTAGE. How do I do this?
I was browsing Stack Overflow and think I might have a solution to your question. If you create a job to grab all of the IP_ADDRESS's from the file and send them to a BASIC transformer (search for BASIC transformer in DataStage. It is NOT the one that is normally on the palette). From there, set the Stage Variables as 'SetUserStatus() and write out the column name to a peek stage (You don't need the output at all. The SetUserStatus is the important part). This will now allow you to pass up the Command Output (list of IP Addresses) to a Sequence. From the Sequence, start with the job you just created (BASIC transformer job) and link that to a User Variables Activity. In the User Variables Activity stage, Set the name to something like 'IP Address' and Expression as IP_ADDRESS.$UserStatus. You can then use a Loop to take that output that is now a List and send each individual IP Address to an Execute Stage with a Ping command to see if it returns a valid IP Address. If it does return a valid IP then have your job that writes the USER_NAME and IP_ADDRESS to do a 'Select' statement where the IP_ADDRESS = the valid IP_ADDRESS. For the ones that aren't valid, you can send them down a different path and have them write out to '.txt' file somewhere so you know which ones weren't valid. I'm sure you will need a few more steps in there but that should be the gist of it.
Hope my quick stab at your issue helps.
Yes, you can use a transformer or a transformer and a filter to do that, depending on the version of Datastage you're using. If you're using PX, just encode the validation logic in a transformer stage, and then, on the output link set up a filter that doesn't allow the rows to pass forward if they didn't pass the validation logic.

Adding entry to task_struct and initializing to default value

I want to add an entry to process control block structure (task_struct). Let say a way to tag some process. I want to initialize this field to 0 for all the process except "some special processes", later by calling sched_setscheduler() I will set this flag for the "special processes".
Does anybody have an idea how to assign a default value to a member variable in task_struct?
I'm assuming you are talking about a recent Linux kernel, because implementation detail changes over time.
There are two options. The first - you can set the value of the variable in the init_task global. See how it is done in the linux/init_task.h header. The second option is to add code to copy_process, which you might want to do anyway in order to properly handle the fork() inheritance of the field you are adding.

Resources