Given your example, I do not think that VAL is a suitable solution.
$node = "L1A3456789"
$sAsset=SubStr($node,2,6)
yields "1A3456" which is not 6 consecutive number and yields a value of only 1 (one).
My recommendation would be to use regular expressions, but first you need to clarify your example and your data strings.
See: RFC: Regular Expression UDFs
The code below accepts your input and return the first characters that match 6 consecutive digits.
Result: Match = 345678
Code:
$node = "L1A3456789"
$RegExPattern = '(\d{6})'
$Matches = RegExpFind($RegExPattern, $node, 1, 0)
? "Match = " + $Matches[0][0]
Function RegExpFind($Pattern, $String, $IgnoreCase, $Global)
Dim $regEx, $Match, $Matches, $i, $j, $k ; Create variable.
Dim $Results[0]
$regEx = createobject("VBscript.RegExp") ; Create a regular expression.
$regEx.Pattern = $Pattern ; Set pattern.
$regEx.IgnoreCase = val($IgnoreCase) ; Set case insensitivity.
$regEx.Global = val($Global) ; Set global applicability.
$Matches = $regEx.Execute($String) ; Execute search.
$k=0
For Each $Match in $Matches ; Iterate Matches collection.
Dim $MatchValue[0]
ReDim Preserve $Results[$k]
$MatchValue[0] = $Match.Value
if $Match.Submatches.count > 0
for $i=0 to $Match.Submatches.count
ReDim Preserve $MatchValue[$i+1]
$MatchValue[$i+1] = $Match.Submatches($i)
next
endif
$Results[$k] = $MatchValue
$k=$k+1
Next
$RegExpFind = $Results
EndFunction