Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everybody,
I'm trying to find a solution for generate DATA.
I've this table:
A | B |
---|---|
XX | 1 |
AA | 2 |
BB | 3 |
and I 'd like to have
A | B |
---|---|
XX1 | 1 |
XX2 | 1 |
XX3 | 1 |
AA1 | 2 |
AA2 | 2 |
AA3 | 2 |
BB1 | 3 |
BB2 | 3 |
BB3 | 3 |
I've ever try to do a loop like
set a=1;
Do while a<10
load A&$(a) as A ,B;
Let a=a+1;
Loop
But it 's not working.
Thanks for your help.
Maybe without loop?
input:
load * inline [
A B
XX 1
AA 2
BB 3
](delimiter is '\t');
A_tab:
LOAD A RESIDENT input;
join
LOAD B RESIDENT input;
B_tab:
LOAD A&B AS AB, A RESIDENT A_tab;
left join
LOAD A, B RESIDENT input;
DROP TABLES input, A_tab;