Any ideas?

Reply
New Contributor
Posts: 2

Any ideas?

I am trying to report on this data that is not consistent ( My key from Description should be #RUN)

example:

ID          JOB            DESCRIPTION
12301 ABC100    JOB RUN SUCCESS RUN# R12310
12302 ABC101    JOB DID NOT RAN
  DO TO FAILURE RUN# R12311
12303 ABC102    JOB RUN SUCCESS RUN# R12312
12304 ABC103    JOB DID DID NOT RUN BECAUSE
  CONDITION DID NOT SATISFY
  IN RUN# R12313
12305 ABC104    JOB DID NOT RAN
  DO TO FAILURE RUN# R12314


REPORT
ID        JOB        RUN_ID
12301 ABC100 R12310
12302 ABC101 R12311
12303 ABC102 R12312
12304 ABC103 R12313
12305 ABC105 R12314

PROC Star
Posts: 7,471

Re: Any ideas?

You are going to have to do more work if you also need description as there is only one space between the description and the jobid.  However, if you don't need the description, you can get away with:

data want;

  informat job $6. run_id $6.;

  input ID JOB  @"RUN#" run_id;

  cards;

12301 ABC100    JOB RUN SUCCESS RUN# R12310

12302 ABC101    JOB DID NOT RAN

  DO TO FAILURE RUN# R12311

12303 ABC102    JOB RUN SUCCESS RUN# R12312

12304 ABC103    JOB DID DID NOT RUN BECAUSE

  CONDITION DID NOT SATISFY

  IN RUN# R12313

12305 ABC104    JOB DID NOT RAN

  DO TO FAILURE RUN# R12314

;

proc print data=want;

  var ID JOB run_id;

run;

New Contributor
Posts: 2

Re: Any ideas?

It is one space between jobid and description, but the big idea is to have only RUN# from description.

PROC Star
Posts: 7,471

Re: Any ideas?

Then did you try the code I suggested?  I think it does exactly what you want.

Ask a Question
Discussion stats
  • 3 replies
  • 179 views
  • 0 likes
  • 2 in conversation