Hi cosmid.
You are right, it is not supposed to be a period after the myfile.
🙂
I am sorry, I've misspelled that.
When dealing with complex text parsing, I find always better to access the automatic _INFILE_ buffer variable. Being a buffer, there's no need to pre-alocate it's maximum size (as you should do with a variable) and It will hold precisely the exact record that was retrieved from the file.
Benefits for that? Say, I just want to parse the line and retrieve some 4 char code placed somewhere in the middle. Using _INFILE, there's no need to pre-alocate a "large-enough" variable to hold the line, I just have to process the _INFILE_ auto variable and extract what I need from it.
Check the paper of Howard Schreier about the _INFILE_ var:
http://www.nesug.org/Proceedings/nesug01/cc/cc4018bw.pdf
Now, unless each line as strictly 150 chars OR you specified the option TRUNCOVER in the INFILE statement, I wouldn't use:
input line $ 150.;
Instead, try this:
length LINE $150;
input LINE;
Here, the first 150 chars of each line are read to the LINE variable.
Of course, if no line has more than 150 chars, no truncation will occur and every line will be processed entirely.
Hope this helps.
Cheers from Portugal.
Daniel Santos @
www.cgd.pt