*---------/mscdc/sas/formats/Tools/segout.sas----------*; x cd /mscdc/sas/formats/Tools; options mprint; %pgm(segout) options nomprint; /* This creates the segout format which contains the correspondence of street/unit type codes derived from admatch with standard abbreviations. The prepadd macro uses it to create standardized address files based on the somewhat arbitrary type/unit standard abbreviations defined by the format. The code input for this format agrees with the codes output by the segtabl format. RUN 3/6/98 JWS */ libname library clear; libname library '/mscdc/sasctlgs'; filename text '/mscdc/sas/formats/Ssegout.sas'; PROC FORMAT cntlout=genfmtin; VALUE $segout '305'=' ' '225'='AL' '219'='ANX' '301'='APT' '207'='AVE' '403'='BLDG' '204'='BLVD' '309'='BOX' '241'='BRDG' '220'='CSWY' '205'='CIR' '206'='CT' '240'='COVE' '238'='CTR' '212'='DR' '103'='E' '203'='EXT' '237'='EXWY' '402'='FLR' '242'='FRWY' '221'='GDNS' '210'='HWY' '214'='ISL' '208'='LN' '310'='LOT' '239'='MALL' '223'='MNR' '101'='N' '113'='NE' '114'='NW' '216'='PATH' '215'='PKWY' '213'='PL' '211'='PLZ' '218'='PT' '202'='RD' '302'='RM' '243'='ROW' '102'='S' '123'='SE' '230'='SQ' '201'='ST' '303'='SUIT' '124'='SW' '209'='TE' '217'='TL' '226'='TPKE' '236'='TRL' '304'='UNIT' '104'='W' '235'='WALK' '222'='WAY' OTHER=' ' ; run; ***CHANGE ARGLEN AND LABELLEN***; %genfmat(setin=genfmtin,fmatname=segout,arglen=3,other=' ', argvars=start,labelvar=label,labellen=4,savedoc=0); title2 'Partial Print of Format Source'; data _null_; infile text obs=50; input; file print; put _infile_; run; *---test the format---*; data _null_; set genfmtin(obs=10 keep=start label); length result $4; *<===change; result=put(start,$segout.); put start= label= result=; run; run;