I'm a new user to SAS and am in the process of updating someone elses code, for the most part no issues, except this one which has left me puzzled. I'm running a data step that is adding new fields (only showing one in my example) and applying a formats run earlier as part of a Proc Format process.
Issue: When the process runs, only one of the formats is pickedup. Meaning, all records regardless of bsnss_unt_id get the same format . . . any help would be appreciated
data Table5;
set Table4;
naalr_bnd = naalr_scr;
/* groups naalr band */
if bsnss_unt_id = 702 then do;
format naalr_bnd naalrs.;
end;
else if bsnss_unt_id = 803 then do;
format naalr_bnd naalra.;
end;
run;
endrsubmit;
proc format;
value naalra
0 - 0 = '01_000-000'
1 - 349 = '02_001-349'
350 - 354 = '03_350-354'
355 - 359 = '04_355-359'
360 - 364 = '05_360-364'
365 - 369 = '06_365-369'
370 - 374 = '07_370-374'
375 - 379 = '08_375-379'
380 - 384 = '09_380-384'
385 - 389 = '10_385-389'
390 - 394 = '11_390-394'
395 - 399 = '12_395-399'
400 - 404 = '13_400-404'
405 - 409 = '14_405-409'
410 - 414 = '15_410-414'
415 - 419 = '16_415-419'
420 - 424 = '17_420-424'
425 - 429 = '18_425-429'
430 - 434 = '19_430-434'
435 - 439 = '20_435-439'
440 - high= '21_440-999 '
other = 'missing';
value naalrs
0 - 384 = '01_000-384'
385 - 399 = '02_385-399'
400 - 414 = '03_400-414'
415 - 424 = '04_415-424'
425 - 459 = '05_425-459'
460 - high= '6_460+'
other = 'missing';