Using tJavaRow to display row information
Although tLogRow
is flexible and very useful, it does have some limitations, in that it only prints what is defined in a schema. tJavaRow
doesn't have the same limitations. This recipe will show you how it can be utilized.
Getting ready
Open the jo_cook_ch10_0060_tJavaRow
job.
How to do it...
The steps for using tJavaRow to display row information are as follows:
Run the job. You will see data in the console output sorted by customer key.
Remove the
tLogRow
component, and add atJavaRow
component in its place.Open the
tJavaRow
component and add the following code://Test for change of key and print heading lines if key has changed if (Numeric.sequence(input_row.name, 1, 1) == 1){ System.out.println("\n\n******************** Records for customer name: "+input_row.name+" ***********************"); System.out.printf("%-20s %-20s %-30s %-3s \n","name","DOB","timestamp","age"); } // print formatted output fields System.out.printf("%-20s %-20s %...