BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
art297
Opal | Level 21

I will guess that your error occurred when you imported the file and possibly read the first line (the variable name header) as data. The following worked for me:

data have;

  format tradedate ddmmyy10.;

  infile "c:\temp\buy_16mar2015.csv" dlm=',' firstobs=2;

  input tradedate ddmmyy10. cusip :$15.;

run;

data want;

  set have;

  cusip = substr(cusip, 3, length(cusip)-4);

run;

MarkWik
Quartz | Level 8

Hello, It would be nice and courteous of you if you could mark the question as answered and gift the points to the people who have helped you. Asking questions, one after another is alright but please acknowledge the help. Thanks

AbuChowdhury
Fluorite | Level 6

Hi,

I will definitely do that. I was just checking all codes. And thanks a lot to everybody. I am grateful to all of you. I wanted to mark 'correct' or 'helpful' to everybody but I cannot.

art297
Opal | Level 21

Abu: Out of curiosity, why didn't Astounding's originally suggested code work for you?

AbuChowdhury
Fluorite | Level 6

Hi Arthur,

I don't know actually. It showed the following notes and output dataset had no observations.

NOTE: Numeric values have been converted to character values at the places given by:

      (Line):(Column).

      127:16

NOTE: Character values have been converted to numeric values at the places given by:

      (Line):(Column).

      127:9

It may be because I missed something while running the code. I also wanted to mark Astounding's code as correct or helpful answer, but I couldn't. After I marked two helpful answers, I found that I cannot choose anymore. But Astounding's code is really helpful (and may be correct; I don't know exactly since I could not run the code).

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 19 replies
  • 7406 views
  • 8 likes
  • 9 in conversation