BookmarkSubscribeRSS Feed
EricB40
Fluorite | Level 6

data MARRIAGE;
infile '/home/u63556826/sasuser.v94/MARR500 (2).DAT';

input WOMAN 1-5
MARRSTAT $ 7
GATTPREG 25-26
HATTPREG 27-28;


if MARRSTAT = 8 then MARRSTAT = .;
if MARRSTAT = 9 then MARRSTAT = .;
if GATTPREG > 8 then GATTPREG = .;
IF HATTPREG > 8 then HATTPREG = .;


if 0<= GATTPREG < 5 then GR_ATTITUDE = 1;
if GATTPREG >=5 then GR_ATTITUDE = 0;

if 0<= HATTPREG < 5 then HB_ATTITUDE = 1;
if HATTPREG >=5 then HB_ATTITUDE = 0;

 

proc print data=marriage;


label WOMAN = "Mother's ID";
label MARRSTAT = "Marital Status";
label GATTPREG = "Gravida's Attitude Towards Pregnancy";
label HATTPREG = "Husband's Attitude Towards Pregnancy";


run;

 

In procprint, the labels still say Woman, MARRSTAT, etc.

2 REPLIES 2
ballardw
Super User

Proc Print is very old and needs to be told explicitly to use labels:

 

proc print data=marriage LABEL;

Parially has to do with some of the options designed for line printers.

 

If you don't actually want the observation number column then the option NOOBS will suppress those.

 

 

EricB40
Fluorite | Level 6

thank you for your help

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 116 views
  • 0 likes
  • 2 in conversation