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

Hello, 

 

I wrote a SAS code to import a raw file which looks something like the attached snapshot in the end

data WORK.UPCS_FILE    ;
infile 'temp_all.upcs' delimiter = ',' MISSOVER DSD lrecl=32767 firstobs=3 ;
 input xab 1-6
 UPC 9-20
 UPC_Desc$ 22-51
 size$ 52-64
 MUP 67-69
 date 70-76
 storeweeks 78-87
 caus_sw 88-92
 median_price 93-99;
run;

. The output data looks perfectly alright except the fact that the last column (median price) comes out blank for quite a few observations. e.g below

 

xabUPCUPC_DescsizeMUPdatestoreweekscaus_swmedian_price
11724'99' 1.0 LTR1.000 LTR1201290 
24091'99' 1.0 LTR1.000 LTR120780 
31586'99' LIGHT 1.0 LTR1.000 LTR120760 
44024'99' LIGHT 1.0 LTR1.000 LTR120380 
5448721 BARREL RUM 1.0 LTR1.000 LTR12070 
6271481 BARREL RUM 750 ML750.000 ML1201230 

 

I am also attaching a snapshot of raw data. I can't copy paste the raw data here because it looses format. 

raw file snapshot.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
tolapa
Fluorite | Level 6

I shortened the lenght of last variable and seems to be doing the right thing now

View solution in original post

3 REPLIES 3
Patrick
Opal | Level 21

@tolapa 

Just as a thought: Try TRUNCOVER instead of MISSOVER

 

"I am also attaching a snapshot of raw data. I can't copy paste the raw data here because it looses format." 

Use the {i} icon and copy or data into the window that pops up or even better directly attach your raw data as a text file (Attachments / Chose Files)

tolapa
Fluorite | Level 6

thanks a lot for looking into it

tolapa
Fluorite | Level 6

I shortened the lenght of last variable and seems to be doing the right thing now

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
  • 3 replies
  • 1208 views
  • 2 likes
  • 2 in conversation