BookmarkSubscribeRSS Feed
pdhokriya
Pyrite | Level 9
ygcd(RAW) ygtx(RAW) val(Target) pcd(target) yg(raw)
DEL70 NEW 11(num datatype) DEL70N 11
DEL70 OLD 22 DEL70T 22
DEL70 PROPER 33 DEL70D 33

 

Hi I am using EG 7.2 also MS office competible.

Without excel raw also I am ok .

 

Hi ,

 

Can we make macro by using excel raw data???? ( ygcd,ygtx,val, pcd )

 

When new is present then at the end of pcd = _____N;

when old is present then at the end of pcd=_____T;

When Proper is present then at the end of pcd = ____D;

 

 

data T2;
set T1;
if ygcd="DEL70" and ygtx="NEW" then do ;
val = input (yg, best.);
pcd = "DEL70N";
end;
if ygcd="DEL70" and ygtx="OLD" then do ;
val = input (yg, best.);
pcd = "DEL70T";
end;
if ygcd="DEL70" and ygtx="PROPER" then do ;
val = input (yg, best.);
pcd = "DEL70D";
end;
run;

 

Regards

Priyanka

4 REPLIES 4
LinusH
Tourmaline | Level 20

Seem that there are sverel questions here.

 

Can you use Excel raw data: if you  mean a regular spreadsheet - yes. But depends on what license you have etc.

How do you mean a macro would work in your scenario?

 

If you can show what input data you have (Excel raw and potentially other) and the desired output (in table format and potentially report if that is your goal).

Data never sleeps
pdhokriya
Pyrite | Level 9
ygcd(RAW) ygtx(RAW) val(Target) pcd(target) yg(raw)
DEL70 NEW 11(num datatype) DEL70N 11
DEL70 OLD 22 DEL70T 22
DEL70 PROPER 33 DEL70D 33


Hi I am using EG 7.2 also MS office competible.

Without excel raw also I am ok .

Reeza
Super User
What do you mean by a macro? A SAS or Excel macro? What would that macro do and why do you think you need a macro? Please clarify in detail by showing what you have in Excel, what you have in SAS and what you want as an output.

I'm assuming by your references to Excel that you're using the SAS Add In for Microsoft Excel? Is that correct?

I'm assuming when you say you're familiar with "Excel Raw" that you're comfortable working in Excel, but not in SAS or with the Add on. Is that correct?
pdhokriya
Pyrite | Level 9
I am only talking about SAS macro

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
  • 687 views
  • 0 likes
  • 3 in conversation