dil77,
1) CTE can be used in Views (in the LUW 9.5 manual. I don't have access to z/OS manual at the moment, but I believe Views can have CTE also).
2) CTE do not require having column names defined. As long as you use columns backed by an actual table, DB2 will used the columns attributes. But if you use constants or derived values, you need to use columns and define the datatypes. NOTE: I always define the columns anyway as it is a good documentation and easy to fined what the columns in the CTE are instead of looking at the SQL and/or going to the Catalog tables to find the info.
As for getting the results you want, What do you want.
1 row starting at a specified node?
ex:
for Node 1: 1, 2, 3, 6, null, null, null, null, null, null
or
for Node 2: 2, 3, 6, null, null, null, null, null, null
etc.
Multiple rows (1 row for every distinct node)?
1, 2, 3, 6,, NULL, NULL, NULL, NULL, NULL, NULL
2, 3, 6,, NULL, NULL, NULL, NULL, NULL, NULL, NULL
3, 6,, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
6, , NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
4, 5, 7,, NULL, NULL, NULL, NULL, NULL, NULL, NULL
5, 7, , NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
7, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL