BookmarkSubscribeRSS Feed
raja777pharma
Fluorite | Level 6

Hi ,

 

I would like to display the lines in red color or higlight with end line with any symbol which are records value 'N'  (DTHAPAFL = 'N' ) for one variable in data.

Below snip of my data and all data was attaced as excel file.

 

raja777pharma_0-1649919197457.png

 

I am using below code to genrate plot.

 

proc sgplot data=final;
	
	highlow Y=N low=RANDDT1 high=ADT1/lineattrs=(thickness=1.5 pattern=solid 
		color=grey) name='C' legendlabel='Follow-up Days';
	
	highlow Y=N low=RANDDT2 high=ADT2/lineattrs=(thickness=1.5 pattern=solid 
		color=charcoal) name='C' legendlabel='Follow-up Days';
		
	
	yaxis label="Subjects (N = %trim(n99))" values=(0 100 200 300 400 500 600 700 800 900 1000 );
	xaxis label="Study Calendar" interval=quarter VALUESFORMAT=MONYY7.;
	
	refline "11Mar2020"d/ axis=x lineattrs=(thickness=3 pattern=dash color=black) 
		label="cutoffdt. (COVID-19 Pandemic Date)";
	
	inset "%trim(30)% Of follow-up days" 
		/ position=left textattrs=(color=black size=9);
	
	inset 
		"%trim(70)% Of follow-up days" / 
		position=right textattrs=(color=black size=9);
		
	format RANDDT1 ADT1 RANDDT2 ADT2 data9. ;
run;

My output;

raja777pharma_1-1649919322198.png

 

I am expeccting output as below , whcih records have DTHAPAFL = 'N' those will be higlight in red color or line ending with any symbol with red color , like below.

 

raja777pharma_2-1649919441004.png

 

Thank you,

Rajasekhar.

 

 

 

4 REPLIES 4
sbxkoenk
SAS Super FREQ

Just moved this topic to 'Graphics Programming' board

, as it will have a higher chance to get an answer over here.

 

Thanks,

Koen

ballardw
Super User

Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software or policy. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.

 

Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the </> icon or attached as text to show exactly what you have and that we can test code against.

 

First thing I would try is the plot of the desired variables with the option  / group=DTHAPAFL. That will create plots with different attributes for each value of the variable. If you only have N and missing that should get you started. You should be able to provide an overide of the lineattrs to get red.

 

You may have to watch transparency settings when you stack multiple plots as the order they are drawn might have something you want "under" a solid color and not visible.

raja777pharma
Fluorite | Level 6

Hi ,

 

I have used the code to create data step code , but it didn't work properly.

 

But data was genrated in log here is below;

 

data FINAL_01;
   infile datalines dsd truncover;
   input USUBJID:$20. DTHDT:$5. DTHAPAFL:$1. cutoff:DATE9. adt2:DATE9. randdt2:DATE9. adt1:DATE9. randdt1:DATE9. N:32.;
   format cutoff DATE9. adt2 DATE9. randdt2 DATE9. adt1 DATE9. randdt1 DATE9.;
   label USUBJID="USUBJID" DTHDT="DTHDT" DTHAPAFL="DTHAPAFL" cutoff="cutoff" adt2="adt2" randdt2="randdt2" adt1="adt1" randdt1="randdt1";
 datalines;
D169CC00001/E1016001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 01SEP2018 1
D169CC00001/E1016003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 08SEP2018 2
D169CC00001/E1016004 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 08SEP2018 3
D169CC00001/E7804004 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 13SEP2018 4
D169CC00001/E7811001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 19SEP2018 5
D169CC00001/E7804003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 20SEP2018 6
D169CC00001/E7817002 43932 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 20SEP2018 7
D169CC00001/E1003003 43544 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 26SEP2018 8
D169CC00001/E7817003 43653 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 04OCT2018 9
D169CC00001/E1002001 44002 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 13OCT2018 10
D169CC00001/E1002002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 13OCT2018 11
D169CC00001/E1016006 44204 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 16OCT2018 12
D169CC00001/E6209004 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 18OCT2018 13
D169CC00001/E6209001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 19OCT2018 14
D169CC00001/E1016007 43565 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 20OCT2018 15
D169CC00001/E5702001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 22OCT2018 16
D169CC00001/E6210001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 22OCT2018 17
D169CC00001/E6205002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 23OCT2018 18
D169CC00001/E6216001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 23OCT2018 19
D169CC00001/E6219007 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 23OCT2018 20
D169CC00001/E7804008 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 23OCT2018 21
D169CC00001/E4323001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 24OCT2018 22
D169CC00001/E5702003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 24OCT2018 23
D169CC00001/E6219005 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 24OCT2018 24
D169CC00001/E6219009 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 24OCT2018 25
D169CC00001/E7817006 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 24OCT2018 26
D169CC00001/E4307003 44178 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 25OCT2018 27
D169CC00001/E5702002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 25OCT2018 28
D169CC00001/E0903001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 29OCT2018 29
D169CC00001/E1003005 44266 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 29OCT2018 30
D169CC00001/E4306001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 29OCT2018 31
D169CC00001/E6205001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 29OCT2018 32
D169CC00001/E7843002 44405 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 29OCT2018 33
D169CC00001/E4306002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 30OCT2018 34
D169CC00001/E4306004 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 30OCT2018 35
D169CC00001/E4314001 44426 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 30OCT2018 36
D169CC00001/E4323002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 30OCT2018 37
D169CC00001/E4324002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 30OCT2018 38
D169CC00001/E4336001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 30OCT2018 39
D169CC00001/E1004001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 31OCT2018 40
D169CC00001/E4305001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 31OCT2018 41
D169CC00001/E4306003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 31OCT2018 42
D169CC00001/E4320001 44221 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 31OCT2018 43
D169CC00001/E6205005 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 31OCT2018 44
D169CC00001/E7809001 43608 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 31OCT2018 45
D169CC00001/E0912001 44343 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 01NOV2018 46
D169CC00001/E0912002 43646 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 01NOV2018 47
D169CC00001/E4324003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 01NOV2018 48
D169CC00001/E4332001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 01NOV2018 49
D169CC00001/E6216003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 01NOV2018 50
D169CC00001/E0912004 43464 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 02NOV2018 51
D169CC00001/E4304001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 02NOV2018 52
D169CC00001/E4314002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 02NOV2018 53
D169CC00001/E6205006 44233 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 02NOV2018 54
D169CC00001/E6205008 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 02NOV2018 55
D169CC00001/E6205009 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 02NOV2018 56
D169CC00001/E1002003 44306 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 03NOV2018 57
D169CC00001/E1002004 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 03NOV2018 58
D169CC00001/E1018004 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 04NOV2018 59
D169CC00001/E0902001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 05NOV2018 60
D169CC00001/E0912003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 05NOV2018 61
D169CC00001/E1001001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 05NOV2018 62
D169CC00001/E4332003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 05NOV2018 63
D169CC00001/E4344001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 05NOV2018 64
D169CC00001/E5002001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 05NOV2018 65
D169CC00001/E7827001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 05NOV2018 66
D169CC00001/E4311001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 06NOV2018 67
D169CC00001/E4324004 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 06NOV2018 68
D169CC00001/E6205004 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 06NOV2018 69
D169CC00001/E6205013 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 06NOV2018 70
D169CC00001/E7843001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 06NOV2018 71
D169CC00001/E1018006 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 07NOV2018 72
D169CC00001/E4306005 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 07NOV2018 73
D169CC00001/E4307004 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 07NOV2018 74
D169CC00001/E4311002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 07NOV2018 75
D169CC00001/E4314004 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 07NOV2018 76
D169CC00001/E4323003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 07NOV2018 77
D169CC00001/E6205012 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 07NOV2018 78
D169CC00001/E6205019 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 07NOV2018 79
D169CC00001/E6219011 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 07NOV2018 80
D169CC00001/E6219013 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 07NOV2018 81
D169CC00001/E7843003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 07NOV2018 82
D169CC00001/E0905004 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 08NOV2018 83
D169CC00001/E5702004 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 08NOV2018 84
D169CC00001/E6219015 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 08NOV2018 85
D169CC00001/E6219017 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 08NOV2018 86
D169CC00001/E4304002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 09NOV2018 87
D169CC00001/E4316002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 09NOV2018 88
D169CC00001/E4336002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 09NOV2018 89
D169CC00001/E6205011 44011 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 09NOV2018 90
D169CC00001/E6205014 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 09NOV2018 91
D169CC00001/E6205018 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 09NOV2018 92
D169CC00001/E6209006 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 09NOV2018 93
D169CC00001/E6219010 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 09NOV2018 94
D169CC00001/E1016008 43973 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 10NOV2018 95
D169CC00001/E1016009 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 10NOV2018 96
D169CC00001/E0915001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 12NOV2018 97
D169CC00001/E1003006 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 12NOV2018 98
D169CC00001/E4313001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 12NOV2018 99
D169CC00001/E4322001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 12NOV2018 100
D169CC00001/E0905002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 13NOV2018 101
D169CC00001/E0905003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 13NOV2018 102
D169CC00001/E0905005 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 13NOV2018 103
D169CC00001/E0912008 43784 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 13NOV2018 104
D169CC00001/E0915002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 13NOV2018 105
D169CC00001/E1908001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 13NOV2018 106
D169CC00001/E4336003 44541 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 13NOV2018 107
D169CC00001/E4342001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 13NOV2018 108
D169CC00001/E6201002 44356 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 13NOV2018 109
D169CC00001/E6209008 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 13NOV2018 110
D169CC00001/E7843004 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 13NOV2018 111
D169CC00001/E0912007 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 14NOV2018 112
D169CC00001/E0912009 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 14NOV2018 113
D169CC00001/E1908003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 14NOV2018 114
D169CC00001/E4303001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 14NOV2018 115
D169CC00001/E4314003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 14NOV2018 116
D169CC00001/E4316003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 14NOV2018 117
D169CC00001/E4336004 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 14NOV2018 118
D169CC00001/E4336005 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 14NOV2018 119
D169CC00001/E7837001 43935 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 14NOV2018 120
D169CC00001/E0907001 43491 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 15NOV2018 121
D169CC00001/E0912011 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 15NOV2018 122
D169CC00001/E1908002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 15NOV2018 123
D169CC00001/E1911001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 15NOV2018 124
D169CC00001/E4307006 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 15NOV2018 125
D169CC00001/E4314005 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 15NOV2018 126
D169CC00001/E5702005 44281 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 15NOV2018 127
D169CC00001/E6201004 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 15NOV2018 128
D169CC00001/E7817008 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 15NOV2018 129
D169CC00001/E0903002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 16NOV2018 130
D169CC00001/E4303002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 16NOV2018 131
D169CC00001/E4314006 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 16NOV2018 132
D169CC00001/E4317001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 16NOV2018 133
D169CC00001/E4323005 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 16NOV2018 134
D169CC00001/E4323006 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 16NOV2018 135
D169CC00001/E6210005 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 16NOV2018 136
D169CC00001/E7802001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 16NOV2018 137
D169CC00001/E1005001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 19NOV2018 138
D169CC00001/E1904001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 19NOV2018 139
D169CC00001/E1908004 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 19NOV2018 140
D169CC00001/E4314007 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 19NOV2018 141
D169CC00001/E4336006 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 19NOV2018 142
D169CC00001/E6210004 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 19NOV2018 143
D169CC00001/E6210006 44447 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 19NOV2018 144
D169CC00001/E7009001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 19NOV2018 145
D169CC00001/E7009002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 19NOV2018 146
D169CC00001/E7009003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 19NOV2018 147
D169CC00001/E7806002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 19NOV2018 148
D169CC00001/E0902002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 20NOV2018 149
D169CC00001/E1003007 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 20NOV2018 150
D169CC00001/E1005002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 20NOV2018 151
D169CC00001/E1013001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 20NOV2018 152
D169CC00001/E4307007 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 20NOV2018 153
D169CC00001/E4311004 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 20NOV2018 154
D169CC00001/E4313002 44553 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 20NOV2018 155
D169CC00001/E4313003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 20NOV2018 156
D169CC00001/E4313004 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 20NOV2018 157
D169CC00001/E4315001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 20NOV2018 158
D169CC00001/E4320002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 20NOV2018 159
D169CC00001/E4328003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 20NOV2018 160
D169CC00001/E4332004 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 20NOV2018 161
D169CC00001/E4335001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 20NOV2018 162
D169CC00001/E5704003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 20NOV2018 163
D169CC00001/E5710002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 20NOV2018 164
D169CC00001/E6206001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 20NOV2018 165
D169CC00001/E6222001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 20NOV2018 166
D169CC00001/E7819001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 20NOV2018 167
D169CC00001/E7819002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 20NOV2018 168
D169CC00001/E0907002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 21NOV2018 169
D169CC00001/E0912012 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 21NOV2018 170
D169CC00001/E0915005 43648 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 21NOV2018 171
D169CC00001/E0915006 44129 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 21NOV2018 172
D169CC00001/E1001003 44195 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 21NOV2018 173
D169CC00001/E4313007 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 21NOV2018 174
D169CC00001/E4327001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 21NOV2018 175
D169CC00001/E4330001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 21NOV2018 176
D169CC00001/E4336007 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 21NOV2018 177
D169CC00001/E6212001 44040 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 21NOV2018 178
D169CC00001/E6219020 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 21NOV2018 179
D169CC00001/E7006002 43619 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 21NOV2018 180
D169CC00001/E0903003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 22NOV2018 181
D169CC00001/E0907003 43854 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 22NOV2018 182
D169CC00001/E1001004 44321 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 22NOV2018 183
D169CC00001/E1905003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 22NOV2018 184
D169CC00001/E1910003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 22NOV2018 185
D169CC00001/E7007001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 22NOV2018 186
D169CC00001/E0912013 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 23NOV2018 187
D169CC00001/E1905002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 23NOV2018 188
D169CC00001/E7003001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 23NOV2018 189
D169CC00001/E4307009 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 24NOV2018 190
D169CC00001/E0905007 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 26NOV2018 191
D169CC00001/E0915003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 26NOV2018 192
D169CC00001/E0915004 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 26NOV2018 193
D169CC00001/E1009001 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 26NOV2018 194
D169CC00001/E1904002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 26NOV2018 195
D169CC00001/E1904003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 26NOV2018 196
D169CC00001/E1910002 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 26NOV2018 197
D169CC00001/E4304003 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 26NOV2018 198
D169CC00001/E4311003 43741 N 11MAR2020 13FEB2022 11MAR2020 11MAR2020 26NOV2018 199
D169CC00001/E4314008 .   11MAR2020 13FEB2022 11MAR2020 11MAR2020 26NOV2018 200
;
run;
DanH_sas
SAS Super FREQ

I haven't tested this, but the following should work for you. Add this attribute map data set:

data attrmaps;
length value $ 7 linecolor $ 8 markercolor $ 8;
input ID $ value $ linecolor $ markercolor $;
cards;
DT1 N       red      red
DT1 _OTHER_ grey     grey
DT2 N       red      red
DT2 _OTHER_ charcoal charcoal
;
run;

This creates two attribute maps called "DT1" and "DT2" that will color your lines and markers red for an "n" and everything else either grey or charcoal. To use the attribute map, make the following changes to your code:

 

proc sgplot data=final dattrmap=attrmaps noautolegend;
	
	highlow Y=N low=RANDDT1 high=ADT1/lineattrs=(thickness=1.5 pattern=solid ) group=DTHAPAFL attrid=DT1;
	
	highlow Y=N low=RANDDT2 high=ADT2/lineattrs=(thickness=1.5 pattern=solid ) group=DTHAPAFL attrid=DT2;

DATTRMAP pulls in the attribute map data set. ATTRID specifies which attrmap to use. The GROUP variable is needed for the value to color the plot differently based on the value of DTHAPAFL. I added NOAUTOLEGEND so that the legend for the group variable does not automatically appear (you did not appear to use a legend in your example).

 

Let me know if this works for you.

 

Thanks!

Dan

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 4 replies
  • 749 views
  • 0 likes
  • 4 in conversation