Hello all,
I'm new to this forum. the data is like this:
data a;
A='101';order=1;val=25;p=0;output;
A='101';order=2;val=54;p=0;output;
A='101';order=3;val=66;p=1;output;
A='101';order=4;val=85;p=1;output;
A='101';order=5;val=99;p=0;output;
A='101';order=6;val=120;p=0;output;
A='101';order=7;val=135;p=1;output;
A='101';order=8;val=170;p=1;output;
A='101';order=9;val=186;p=1;output;
A='101';order=10;val=190;p=1;output;
A='101';order=11;val=195;p=1;output;
run;
I've to calculate the difference of two consecutive p=1 i.e., output should have 2 obs with difference of first p=1 and last p=1. Please help.
Name Diff
A 85-66
A 195-135