13%let src=
"%sysfunc(pathname(work))/file.txt";
15%let out1=
"%sysfunc(pathname(work))/file1.txt";
16%let out2=
"%sysfunc(pathname(work))/file2.txt";
17%let out3=
"%sysfunc(pathname(work))/file3.txt";
18%let out4=
"%sysfunc(pathname(work))/file4.txt";
22 put
"startsection&str.endsection";
26%mp_assertscope(SNAPSHOT)
27%mp_chop(&src, matchvar=str, keep=FIRST, outfile=&out1)
28%mp_chop(&src, matchvar=str, keep=LAST, outfile=&out2)
29%mp_chop(&src, matchvar=str, keep=FIRST, matchpoint=END, outfile=&out3)
30%mp_chop(&src, matchvar=str, keep=LAST, matchpoint=END, outfile=&out4)
31%mp_assertscope(COMPARE)
34 infile &out1 lrecl=200;
36 call symputx(
'test1',_infile_);
38 infile &out2 lrecl=200;
40 call symputx(
'test2',_infile_);
42 infile &out3 lrecl=200;
44 call symputx(
'test3',_infile_);
46 infile &out4 lrecl=200;
48 call symputx(
'test4',_infile_);
52 iftrue=(
"&test1" =
"startsection"),
53 desc=Checking keep FIRST matchpoint START
54 outds=work.test_results
57 iftrue=(
"&test2" =
"Chop here!endsection"),
58 desc=Checking keep LAST matchpoint START
59 outds=work.test_results
62 iftrue=(
"&test3" =
"startsectionChop here!"),
63 desc=Checking keep FIRST matchpoint END
64 outds=work.test_results
67 iftrue=(
"&test4" =
"endsection"),
68 desc=Checking keep LAST matchpoint END
69 outds=work.test_results