Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
andrew_smith200
Contributor III
Contributor III

Peek and for next script statement not working

I am trying to load data from using the peek statement as follows:

Temp1:

NoConcatenate

First 3 Load * Resident Temp Order by QVD_Modified_Date desc; //Temp contains file paths with file names (QVD_NAME) and Modified dates to QVDs//

For vNum = 0 to 2 //tried 1 to 2 as well//

let vStart=Peek('QVD_NAME',$(vNum),'Temp1';

load * from [$(vStart)](qvd);

Next

Peek just doesn't want to recognise the variable $(vNum). I have tried '($vNum)', '$vNum', vNum, $vNum, but nothing seems to work yet if I use let vStart=Peek('QVD_NAME',0,'Temp1' then it works perfectly. Just doesn't seem to like variable as the row - anyone have any ideas?

Labels (3)
1 Solution

Accepted Solutions
andrew_smith200
Contributor III
Contributor III
Author

...and the honest answer will be you can't. It will work however if you use the do while loop

e.g. 

set NoOfQvds=3;

let vNum=1

do while vNum < $NoOfQvds)

let vStart=Peek('QVD_Name',S(vNum),'Temp1');

load * from [$(vStart)](cvd);

let vNum=$(vNum)+1

loop

 

View solution in original post

1 Reply
andrew_smith200
Contributor III
Contributor III
Author

...and the honest answer will be you can't. It will work however if you use the do while loop

e.g. 

set NoOfQvds=3;

let vNum=1

do while vNum < $NoOfQvds)

let vStart=Peek('QVD_Name',S(vNum),'Temp1');

load * from [$(vStart)](cvd);

let vNum=$(vNum)+1

loop