BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
guest1994
Calcite | Level 5
data out;
infile "&file" lrecl=525  ;
input 

@1 SOURCECODE $3.
@4 ACCOUNT_NUMBER $20.
@24 SHK_1M_SPS $1.
@25 SHK_2M_SPS $1.
@26 SHK_3M_SPS $1.
@27 SHK_1M_SP $1.
@28 SHK_2M_SP $1.
@29 SHK_3M_SP $1.
@30 SHK_1M_SPA $1.
@31 SHK_2M_SPA $1.
@32 SHK_3M_SPA $1.
@33 SHK_1M_ALL $1.
@34 SHK_2M_ALL $1.
@35 SHK_3M_ALL $1.
@36 CTI_1M_SPS $1.
@37 CTI_1M_SP $1.
@38 CTI_1M_SPA $1.
@39 CTI_1M_ALL $1.
@40 CTI_3M_SPS $1.
@41 CTI_3M_SP $1.
@42 CTI_3M_SPA $1.
@43 CTI_3M_ALL $1.
@44 CTI_6M_SPS $1.
@45 CTI_6M_SP $1.
@46 CTI_6M_SPA $1.
@47 CTI_6M_ALL $1.
@48 CTD_1M_SPS $1.
@49 CTD_1M_SP $1.
@50 CTD_1M_SPA $1.
@51 CTD_1M_ALL $1.
@52 CTD_3M_SPS $1.
@53 CTD_3M_SP $1.
@54 CTD_3M_SPA $1.
@55 CTD_3M_ALL $1.
@56 CTD_6M_SPS $1.
@57 CTD_6M_SP $1.
@58 CTD_6M_SPA $1.
@59 CTD_6M_ALL $1.
@60 EPF_ALL_01 2.
@62 EPF_ALL_02 2.
@64 EPF_ALL_03 2.
@66 EPF_ALL_04 2.
@68 EPF_ALL_05 7.
@75 EPF_ALL_06 7.
@82 EPF_ALL_07 7.
@89 EPF_ALL_08 7.
@96 EPF_ALL_09 7.
@103 EPF_ALL_10 7.
@110 EPF_ALL_11 7.
@117 EPF_ALL_12 7.
@124 EPF_ALL_13 2.
@126 EPF_ALL_14 2.
@128 EPF_ALL_15 2.
@130 EPF_MG_01 2.
@132 EPF_MG_02 2.
@134 EPF_MG_03 2.
@136 EPF_MG_04 2.
@138 EPF_MG_05 7.
@145 EPF_MG_06 7.
@152 EPF_MG_07 7.
@159 EPF_MG_08 7.
@166 EPF_MG_09 7.
@173 EPF_MG_10 7.
@180 EPF_MG_11 7.
@187 EPF_MG_12 7.
@194 EPF_MG_13 2.
@196 EPF_MG_14 2.
@198 EPF_MG_15 2.
@200 EPF_IO_01 2.
@202 EPF_IO_02 2.
@204 EPF_IO_03 2.
@206 EPF_IO_04 2.
@208 EPF_IO_05 7.
@215 EPF_IO_06 7.
@222 EPF_IO_07 7.
@229 EPF_IO_08 7.
@236 EPF_IO_09 7.
@243 EPF_IO_10 7.
@250 EPF_IO_11 7.
@257 EPF_IO_12 7.
@264 EPF_IO_13 2.
@266 EPF_IO_14 2.
@268 EPF_IO_15 2.
@270 EPF_PL_01 2.
@272 EPF_PL_02 2.
@274 EPF_PL_03 2.
@276 EPF_PL_04 2.
@278 EPF_PL_05 7.
@285 EPF_PL_06 7.
@292 EPF_PL_07 7.
@299 EPF_PL_08 7.
@306 EPF_PL_09 7.
@313 EPF_PL_10 7.
@320 EPF_PL_11 7.
@327 EPF_PL_12 7.
@334 EPF_PL_13 2.
@336 EPF_PL_14 2.
@338 EPF_PL_15 2.
@340 EPF_CC_01 2.
@342 EPF_CC_02 2.
@344 EPF_CC_03 2.
@346 EPF_CC_04 2.
@348 EPF_CC_05 7.
@355 EPF_CC_06 7.
@362 EPF_CC_07 7.
@369 EPF_CC_08 7.
@376 EPF_CC_09 2.
@378 EPF_CC_10 2.
@380 EPF_CC_11 2.
@382 SI_ALL_01 2.
@384 SI_ALL_02 7.
@391 SI_ALL_03 2.
@393 SI_ALL_04 2.
@395 SI_ALL_05 7.
@402 SI_DEC_01 2.
@404 SI_DEC_02 2.
@406 SI_DEC_03 7.
@413 SI_PS_01 2.
@415 SI_PS_02 2.
@417 SI_PS_03 7.
@424 SI_DA_01 2.
@426 SI_DA_02 2.
@428 SI_DA_03 7.
@435 SI_GA_01 2.
@437 SI_GA_02 2.
@439 SI_GA_03 7.
@446 SI_REC_01 2.
@448 SI_REC_02 2.
@450 SI_REC_03 7.
@457 SI_VT_01 2.
@459 SI_VT_02 2.
@461 SI_VT_03 7.
@468 SI_ARR_01 2.
@470 SI_ARR_02 2.
@472 SI_ARR_03 7.
@479 SI_DM_01 2.
@481 SI_DM_02 2.
@483 SI_DM_03 7.
@490 SI_CIC_01 2.
@492 SI_CIC_02 2.
@494 SI_CIC_03 7.
@501 SI_QRY_01 2.
@503 SI_QRY_02 2.
@505 SI_QRY_03 7.
@512 SI_DS_01 2.
@514 SI_DS_02 2.
@516 SI_DS_03 7.
;
run;

I would like to add a individual label for each of these variables, how would I do this?

 

For example for the variable sourcecode I want the label to be 'CAIS source code'

For the variable ACCOUNT_NUMBER I want the label to be 'CAIS Account Number' and so on..

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Add something like this after the variables have been defined in either Input, Informat, Attribute or Length statement (since you are reading data). Place the text between the quote marks. If your desired text has " as part of the desired label either replace my " with ' for that variable or place two "" in the body to resolve as one " in the displayed label.

label
 SOURCECODE =" "
 ACCOUNT_NUMBER =" "
 SHK_1M_SPS =" "
 SHK_2M_SPS =" "
 SHK_3M_SPS =" "
 SHK_1M_SP =" "
 SHK_2M_SP =" "
 SHK_3M_SP =" "
 SHK_1M_SPA =" "
 SHK_2M_SPA =" "
 SHK_3M_SPA =" "
 SHK_1M_ALL =" "
 SHK_2M_ALL =" "
 SHK_3M_ALL =" "
 CTI_1M_SPS =" "
 CTI_1M_SP =" "
 CTI_1M_SPA =" "
 CTI_1M_ALL =" "
 CTI_3M_SPS =" "
 CTI_3M_SP =" "
 CTI_3M_SPA =" "
 CTI_3M_ALL =" "
 CTI_6M_SPS =" "
 CTI_6M_SP =" "
 CTI_6M_SPA =" "
 CTI_6M_ALL =" "
 CTD_1M_SPS =" "
 CTD_1M_SP =" "
 CTD_1M_SPA =" "
 CTD_1M_ALL =" "
 CTD_3M_SPS =" "
 CTD_3M_SP =" "
 CTD_3M_SPA =" "
 CTD_3M_ALL =" "
 CTD_6M_SPS =" "
 CTD_6M_SP =" "
 CTD_6M_SPA =" "
 CTD_6M_ALL =" "
 EPF_ALL_01 =" "
 EPF_ALL_02 =" "
 EPF_ALL_03 =" "
 EPF_ALL_04 =" "
 EPF_ALL_05 =" "
 EPF_ALL_06 =" "
 EPF_ALL_07 =" "
 EPF_ALL_08 =" "
 EPF_ALL_09 =" "
 EPF_ALL_10 =" "
 EPF_ALL_11 =" "
 EPF_ALL_12 =" "
 EPF_ALL_13 =" "
 EPF_ALL_14 =" "
 EPF_ALL_15 =" "
 EPF_MG_01 =" "
 EPF_MG_02 =" "
 EPF_MG_03 =" "
 EPF_MG_04 =" "
 EPF_MG_05 =" "
 EPF_MG_06 =" "
 EPF_MG_07 =" "
 EPF_MG_08 =" "
 EPF_MG_09 =" "
 EPF_MG_10 =" "
 EPF_MG_11 =" "
 EPF_MG_12 =" "
 EPF_MG_13 =" "
 EPF_MG_14 =" "
 EPF_MG_15 =" "
 EPF_IO_01 =" "
 EPF_IO_02 =" "
 EPF_IO_03 =" "
 EPF_IO_04 =" "
 EPF_IO_05 =" "
 EPF_IO_06 =" "
 EPF_IO_07 =" "
 EPF_IO_08 =" "
 EPF_IO_09 =" "
 EPF_IO_10 =" "
 EPF_IO_11 =" "
 EPF_IO_12 =" "
 EPF_IO_13 =" "
 EPF_IO_14 =" "
 EPF_IO_15 =" "
 EPF_PL_01 =" "
 EPF_PL_02 =" "
 EPF_PL_03 =" "
 EPF_PL_04 =" "
 EPF_PL_05 =" "
 EPF_PL_06 =" "
 EPF_PL_07 =" "
 EPF_PL_08 =" "
 EPF_PL_09 =" "
 EPF_PL_10 =" "
 EPF_PL_11 =" "
 EPF_PL_12 =" "
 EPF_PL_13 =" "
 EPF_PL_14 =" "
 EPF_PL_15 =" "
 EPF_CC_01 =" "
 EPF_CC_02 =" "
 EPF_CC_03 =" "
 EPF_CC_04 =" "
 EPF_CC_05 =" "
 EPF_CC_06 =" "
 EPF_CC_07 =" "
 EPF_CC_08 =" "
 EPF_CC_09 =" "
 EPF_CC_10 =" "
 EPF_CC_11 =" "
 SI_ALL_01 =" "
 SI_ALL_02 =" "
 SI_ALL_03 =" "
 SI_ALL_04 =" "
 SI_ALL_05 =" "
 SI_DEC_01 =" "
 SI_DEC_02 =" "
 SI_DEC_03 =" "
 SI_PS_01 =" "
 SI_PS_02 =" "
 SI_PS_03 =" "
 SI_DA_01 =" "
 SI_DA_02 =" "
 SI_DA_03 =" "
 SI_GA_01 =" "
 SI_GA_02 =" "
 SI_GA_03 =" "
 SI_REC_01 =" "
 SI_REC_02 =" "
 SI_REC_03 =" "
 SI_VT_01 =" "
 SI_VT_02 =" "
 SI_VT_03 =" "
 SI_ARR_01 =" "
 SI_ARR_02 =" "
 SI_ARR_03 =" "
 SI_DM_01 =" "
 SI_DM_02 =" "
 SI_DM_03 =" "
 SI_CIC_01 =" "
 SI_CIC_02 =" "
 SI_CIC_03 =" "
 SI_QRY_01 =" "
 SI_QRY_02 =" "
 SI_QRY_03 =" "
 SI_DS_01 =" "
 SI_DS_02 =" "
 SI_DS_03 =" "
;

View solution in original post

3 REPLIES 3
Tom
Super User Tom
Super User

Use a LABEL statement.

ballardw
Super User

Add something like this after the variables have been defined in either Input, Informat, Attribute or Length statement (since you are reading data). Place the text between the quote marks. If your desired text has " as part of the desired label either replace my " with ' for that variable or place two "" in the body to resolve as one " in the displayed label.

label
 SOURCECODE =" "
 ACCOUNT_NUMBER =" "
 SHK_1M_SPS =" "
 SHK_2M_SPS =" "
 SHK_3M_SPS =" "
 SHK_1M_SP =" "
 SHK_2M_SP =" "
 SHK_3M_SP =" "
 SHK_1M_SPA =" "
 SHK_2M_SPA =" "
 SHK_3M_SPA =" "
 SHK_1M_ALL =" "
 SHK_2M_ALL =" "
 SHK_3M_ALL =" "
 CTI_1M_SPS =" "
 CTI_1M_SP =" "
 CTI_1M_SPA =" "
 CTI_1M_ALL =" "
 CTI_3M_SPS =" "
 CTI_3M_SP =" "
 CTI_3M_SPA =" "
 CTI_3M_ALL =" "
 CTI_6M_SPS =" "
 CTI_6M_SP =" "
 CTI_6M_SPA =" "
 CTI_6M_ALL =" "
 CTD_1M_SPS =" "
 CTD_1M_SP =" "
 CTD_1M_SPA =" "
 CTD_1M_ALL =" "
 CTD_3M_SPS =" "
 CTD_3M_SP =" "
 CTD_3M_SPA =" "
 CTD_3M_ALL =" "
 CTD_6M_SPS =" "
 CTD_6M_SP =" "
 CTD_6M_SPA =" "
 CTD_6M_ALL =" "
 EPF_ALL_01 =" "
 EPF_ALL_02 =" "
 EPF_ALL_03 =" "
 EPF_ALL_04 =" "
 EPF_ALL_05 =" "
 EPF_ALL_06 =" "
 EPF_ALL_07 =" "
 EPF_ALL_08 =" "
 EPF_ALL_09 =" "
 EPF_ALL_10 =" "
 EPF_ALL_11 =" "
 EPF_ALL_12 =" "
 EPF_ALL_13 =" "
 EPF_ALL_14 =" "
 EPF_ALL_15 =" "
 EPF_MG_01 =" "
 EPF_MG_02 =" "
 EPF_MG_03 =" "
 EPF_MG_04 =" "
 EPF_MG_05 =" "
 EPF_MG_06 =" "
 EPF_MG_07 =" "
 EPF_MG_08 =" "
 EPF_MG_09 =" "
 EPF_MG_10 =" "
 EPF_MG_11 =" "
 EPF_MG_12 =" "
 EPF_MG_13 =" "
 EPF_MG_14 =" "
 EPF_MG_15 =" "
 EPF_IO_01 =" "
 EPF_IO_02 =" "
 EPF_IO_03 =" "
 EPF_IO_04 =" "
 EPF_IO_05 =" "
 EPF_IO_06 =" "
 EPF_IO_07 =" "
 EPF_IO_08 =" "
 EPF_IO_09 =" "
 EPF_IO_10 =" "
 EPF_IO_11 =" "
 EPF_IO_12 =" "
 EPF_IO_13 =" "
 EPF_IO_14 =" "
 EPF_IO_15 =" "
 EPF_PL_01 =" "
 EPF_PL_02 =" "
 EPF_PL_03 =" "
 EPF_PL_04 =" "
 EPF_PL_05 =" "
 EPF_PL_06 =" "
 EPF_PL_07 =" "
 EPF_PL_08 =" "
 EPF_PL_09 =" "
 EPF_PL_10 =" "
 EPF_PL_11 =" "
 EPF_PL_12 =" "
 EPF_PL_13 =" "
 EPF_PL_14 =" "
 EPF_PL_15 =" "
 EPF_CC_01 =" "
 EPF_CC_02 =" "
 EPF_CC_03 =" "
 EPF_CC_04 =" "
 EPF_CC_05 =" "
 EPF_CC_06 =" "
 EPF_CC_07 =" "
 EPF_CC_08 =" "
 EPF_CC_09 =" "
 EPF_CC_10 =" "
 EPF_CC_11 =" "
 SI_ALL_01 =" "
 SI_ALL_02 =" "
 SI_ALL_03 =" "
 SI_ALL_04 =" "
 SI_ALL_05 =" "
 SI_DEC_01 =" "
 SI_DEC_02 =" "
 SI_DEC_03 =" "
 SI_PS_01 =" "
 SI_PS_02 =" "
 SI_PS_03 =" "
 SI_DA_01 =" "
 SI_DA_02 =" "
 SI_DA_03 =" "
 SI_GA_01 =" "
 SI_GA_02 =" "
 SI_GA_03 =" "
 SI_REC_01 =" "
 SI_REC_02 =" "
 SI_REC_03 =" "
 SI_VT_01 =" "
 SI_VT_02 =" "
 SI_VT_03 =" "
 SI_ARR_01 =" "
 SI_ARR_02 =" "
 SI_ARR_03 =" "
 SI_DM_01 =" "
 SI_DM_02 =" "
 SI_DM_03 =" "
 SI_CIC_01 =" "
 SI_CIC_02 =" "
 SI_CIC_03 =" "
 SI_QRY_01 =" "
 SI_QRY_02 =" "
 SI_QRY_03 =" "
 SI_DS_01 =" "
 SI_DS_02 =" "
 SI_DS_03 =" "
;
Reeza
Super User

If the labels are in a data set you can use the approach I've outlined here:

https://gist.github.com/statgeek/f18931085f6a0009185c

 

Otherwise you can add a label statement.

 

label sourcecode = 'Source Code'
account_number = 'Account Number';
Spoiler

@guest1994 wrote:
data out;
infile "&file" lrecl=525  ;
input 

@1 SOURCECODE $3.
@4 ACCOUNT_NUMBER $20.
@24 SHK_1M_SPS $1.
@25 SHK_2M_SPS $1.
@26 SHK_3M_SPS $1.
@27 SHK_1M_SP $1.
@28 SHK_2M_SP $1.
@29 SHK_3M_SP $1.
@30 SHK_1M_SPA $1.
@31 SHK_2M_SPA $1.
@32 SHK_3M_SPA $1.
@33 SHK_1M_ALL $1.
@34 SHK_2M_ALL $1.
@35 SHK_3M_ALL $1.
@36 CTI_1M_SPS $1.
@37 CTI_1M_SP $1.
@38 CTI_1M_SPA $1.
@39 CTI_1M_ALL $1.
@40 CTI_3M_SPS $1.
@41 CTI_3M_SP $1.
@42 CTI_3M_SPA $1.
@43 CTI_3M_ALL $1.
@44 CTI_6M_SPS $1.
@45 CTI_6M_SP $1.
@46 CTI_6M_SPA $1.
@47 CTI_6M_ALL $1.
@48 CTD_1M_SPS $1.
@49 CTD_1M_SP $1.
@50 CTD_1M_SPA $1.
@51 CTD_1M_ALL $1.
@52 CTD_3M_SPS $1.
@53 CTD_3M_SP $1.
@54 CTD_3M_SPA $1.
@55 CTD_3M_ALL $1.
@56 CTD_6M_SPS $1.
@57 CTD_6M_SP $1.
@58 CTD_6M_SPA $1.
@59 CTD_6M_ALL $1.
@60 EPF_ALL_01 2.
@62 EPF_ALL_02 2.
@64 EPF_ALL_03 2.
@66 EPF_ALL_04 2.
@68 EPF_ALL_05 7.
@75 EPF_ALL_06 7.
@82 EPF_ALL_07 7.
@89 EPF_ALL_08 7.
@96 EPF_ALL_09 7.
@103 EPF_ALL_10 7.
@110 EPF_ALL_11 7.
@117 EPF_ALL_12 7.
@124 EPF_ALL_13 2.
@126 EPF_ALL_14 2.
@128 EPF_ALL_15 2.
@130 EPF_MG_01 2.
@132 EPF_MG_02 2.
@134 EPF_MG_03 2.
@136 EPF_MG_04 2.
@138 EPF_MG_05 7.
@145 EPF_MG_06 7.
@152 EPF_MG_07 7.
@159 EPF_MG_08 7.
@166 EPF_MG_09 7.
@173 EPF_MG_10 7.
@180 EPF_MG_11 7.
@187 EPF_MG_12 7.
@194 EPF_MG_13 2.
@196 EPF_MG_14 2.
@198 EPF_MG_15 2.
@200 EPF_IO_01 2.
@202 EPF_IO_02 2.
@204 EPF_IO_03 2.
@206 EPF_IO_04 2.
@208 EPF_IO_05 7.
@215 EPF_IO_06 7.
@222 EPF_IO_07 7.
@229 EPF_IO_08 7.
@236 EPF_IO_09 7.
@243 EPF_IO_10 7.
@250 EPF_IO_11 7.
@257 EPF_IO_12 7.
@264 EPF_IO_13 2.
@266 EPF_IO_14 2.
@268 EPF_IO_15 2.
@270 EPF_PL_01 2.
@272 EPF_PL_02 2.
@274 EPF_PL_03 2.
@276 EPF_PL_04 2.
@278 EPF_PL_05 7.
@285 EPF_PL_06 7.
@292 EPF_PL_07 7.
@299 EPF_PL_08 7.
@306 EPF_PL_09 7.
@313 EPF_PL_10 7.
@320 EPF_PL_11 7.
@327 EPF_PL_12 7.
@334 EPF_PL_13 2.
@336 EPF_PL_14 2.
@338 EPF_PL_15 2.
@340 EPF_CC_01 2.
@342 EPF_CC_02 2.
@344 EPF_CC_03 2.
@346 EPF_CC_04 2.
@348 EPF_CC_05 7.
@355 EPF_CC_06 7.
@362 EPF_CC_07 7.
@369 EPF_CC_08 7.
@376 EPF_CC_09 2.
@378 EPF_CC_10 2.
@380 EPF_CC_11 2.
@382 SI_ALL_01 2.
@384 SI_ALL_02 7.
@391 SI_ALL_03 2.
@393 SI_ALL_04 2.
@395 SI_ALL_05 7.
@402 SI_DEC_01 2.
@404 SI_DEC_02 2.
@406 SI_DEC_03 7.
@413 SI_PS_01 2.
@415 SI_PS_02 2.
@417 SI_PS_03 7.
@424 SI_DA_01 2.
@426 SI_DA_02 2.
@428 SI_DA_03 7.
@435 SI_GA_01 2.
@437 SI_GA_02 2.
@439 SI_GA_03 7.
@446 SI_REC_01 2.
@448 SI_REC_02 2.
@450 SI_REC_03 7.
@457 SI_VT_01 2.
@459 SI_VT_02 2.
@461 SI_VT_03 7.
@468 SI_ARR_01 2.
@470 SI_ARR_02 2.
@472 SI_ARR_03 7.
@479 SI_DM_01 2.
@481 SI_DM_02 2.
@483 SI_DM_03 7.
@490 SI_CIC_01 2.
@492 SI_CIC_02 2.
@494 SI_CIC_03 7.
@501 SI_QRY_01 2.
@503 SI_QRY_02 2.
@505 SI_QRY_03 7.
@512 SI_DS_01 2.
@514 SI_DS_02 2.
@516 SI_DS_03 7.
;
run;

I would like to add a individual label for each of these variables, how would I do this?

 

For example for the variable sourcecode I want the label to be 'CAIS source code'

For the variable ACCOUNT_NUMBER I want the label to be 'CAIS Account Number' and so on..


SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 640 views
  • 1 like
  • 4 in conversation