On Thu, 9 Feb 2012 00:30:37 -0800 (PST), joceyc
...@hotmail.com wrote:
>Hi
>if i have a file that looks like the following :
>-----------------Start---------------
>FIELD001
> LEGAL
> 0
> 1
> 9
> END
> JUMPS
> 1 FIELD555
> END
>END
>FIELD002
> RANGE 1 6
> LEGAL
> 9
> END
>END
>------------------------THE END---------------
>is there anyway for a data step to create such a formated report ?
>Fieldname Jump on Jump to
>========= ======== ===========
>FIELD001 1 FIELD555
>by detecting the key work JUMPS in the file ?
Is this what you mean
The block of lines for a field start with FIELDnnn and stop at the
corresponding END
Ignore everything between LEGAL and its corresponding END (just in
case the word JUMPS shows up there)
For each line between JUMPS and its corresponding END, output the
field name, the condition, and the destination (in case there is more
than one line)
If so, the consider the following in a data step
Retain variables saved_field, flag_legal, flag_jumps
Read a line
If flag_jumps
If line is END
Reset flag_jumps
Else
Output saved_field, condition, and destination
Else if flag_legal
If line is END
Reset flag_legal
Else
If line is FIELDnnn
Set save_field
Else if line is LEGAL
Set flag_legal
Else if line is JUMPS
Set flag_jumps
--
Remove del for email