dataSet's. How do they work? :)

The first snippet is from the API docs and the second is one I'm trying to use.

// Loop through each of the data records.
for( i = 0; i < dataSet.getNumDataRecords(); i++ )
{
// Store the current data record in the variable myDataRecord.
myDataRecord = dataSet.getDataRecord( i );

// Output the "PRODUCT_NAME" value from the data record to the log.
session.log( "Product name: " + myDataRecord.get( "PRODUCT_NAME" ) );

vs

for( i = 0; i < dataSet.getNumDataRecords(); i++ ) {
myDataRecord = dataSet.getDataRecord( i );
session.log( " COMPANY NAME: " + myDataRecord.get( "COMPANY_NAME" ) );
}

The error message was: Attempt to invoke method: getNumDataRecords() on undefined variable or class name: dataSet : at Line: 1

The dataSet is in scope, ie it occurs after the pattern is applied, also tried after each pattern application. On the Advanced tab I have:
Automatically save the data set generated .. checked
Filter duplicate records .. checked and tried unchecked
Cache the data set .. checked

Sidenote: Can I have Identifiers with the same name, select Join (If a data set by the same name... ) and it would 'join' each field to the other in sequence? ie: Name Phone Etc.

As in: "You might want to use the "join" option in cases where you're merging together data sets with different column names."

Is there a better way to achieve matching multiple records on a single page of the same types? Ie:
Name ID
Jay 30
Bill 42
Ephy 51
Paul 19

Thank you for a very fun program! :)

dataSet's. How do they work? :)

I totally figured this all out!
8)