Help using Base SAS procedures

how to determine if service was done

Reply
Regular Contributor
Posts: 240

how to determine if service was done

hi I have 3 tables

1st table shows if service was missed  data is pulling for the pervious month .it looks like this

ID.   date.        Complinace

a1.    07/01/15.       No

a2.       07/05/15.       No

a2.       07/09/15.       No

a3.        07/10/15.      No

2nd table shows if there was a ticket open

ID.         Date.            Tick

a1.        07/05/15.        123

a2.        07/8/15.            124

a3.          07/14/15.           126

the 3rd table would show all the services process in a month...what happens if  service is missed vendor needs to go back. To service  Machine ...but if they don't than there is a ticket that is open base on table 2

id.       Date.      Type

a1.      07/03/15.    service

a2.       07/07/15.    Service

THe output. That I'm looking for is

only when there is match between table 1 and table 2 and doesn't exist on table 3 ... I hope it make sense thanks for assistance

Super User
Posts: 10,483

Re: how to determine if service was done

Have you attempted to combine the first two datasets yet?

Regular Contributor
Posts: 240

Re: how to determine if service was done

hi thanks for  responding  I thought of that but there could be more one occurances of ID an differ date...

the 2d table would id but the date will not be like for like...

Regular Contributor
Posts: 240

Re: how to determine if service was done

sorry  screen froze the 3rd table will show if vendor went back after the miss service date to determine if machine was service if I was then it's good it's when it wasn't an it generates a tick is what I need to output....tthe issue is how to connect tables when id is same but date is differ within a 7 day window thanks for help

Super User
Posts: 9,671

Re: how to determine if service was done

You don't post the output you want yet ?

proc sql;

select id,date from table1

intersect

select id,date from table2

except

select id,date from table3

;

quit;

Regular Contributor
Posts: 240

Re: how to determine if service was done

Xia,

Sorry  the output that I'm looking for is table 1 and table 2  table 3 is my filter 

output

       from 1st table.       From 2nd table        From 3rd table

id. Date  compliance       Tick                           Blank.                  I would report on that

id date.   Compliance.      Tick.                        Service.             I would not report on that.....

here is what I want to do if a machine was not service let say on 8/01/15.  An on 8/4/15 it generates a ticket  than I would report  it

different secnario

machine is is not service on 08/1/15.   And on 08/3/15  it gets service   ThAt gets excluded....

THanks for help

Ask a Question
Discussion stats
  • 5 replies
  • 350 views
  • 0 likes
  • 3 in conversation