Demand Planning.Net: Are you Planning By Exception?
Demand Planning.Net
demand planning, forecasting, and exception management

Importing a flat file can be tricky if the first row contains null values!

Mark C Mar 26, 2005

We need to know that SAS uses the first row of data right after the header row as a guide for the values by column! So if the first row contains a blank value for a column, the rest of the values in that column will be ignored.

Here is a proc import code:

PROC IMPORT OUT= sasdata.custhistoricals
DATAFILE="historyFeb2005.xls"
DBMS=EXCEL2000 REPLACE;
RANGE="datax$";
GETNAMES=YES;
RUN;

One way to overcome this is to add a guide row as the first row after the header line. The guide row will have sample values of data by column so you can have both numeric and text values depending on the type of data. Once you import it, you just delete the guide row.

So the new code will have two more lines.

PROC IMPORT OUT= sasdata.custhistoricals
DATAFILE="historyFeb2005.xls"
DBMS=EXCEL2000 REPLACE;
RANGE="datax$";
GETNAMES=YES;
RUN;

data sasdata.custhistoricals; set sasdata.custhistoricals;

if productID eq ‘guide’ then delete;
run;

happy importing!

Back to SAS Techniques

©2004-2014 by Demand Planning, LLC. All rights reserved. Privacy policy | Refund and Exchange policy | Terms of Service | FAQ
Demand Planning, LLC is based in Boston, MA  | Phone: (781) 995-0685 | Email Us!

Consulting

Diagnostic |  DP Design |  Exception Management |  S&OP |  Solutions

Training

Demand Planning |  S&OP |  Retail Forecasting |  Supply Chain Analysis:  » Value Chain Metrics  » Inventory Optimization |  Supply Chain Collaboration

Industry

CPG/FMCG |  Food and Beverage |  Retail |  Pharma |  High Tech |  Other

Knowledge Base

Planning:  » Budgeting » S&OP |  Metrics: » Demand Metrics » Inventory  » Customer Service |  Collaboration:  » VMI & CMI » Account Based Forecasting
Forecasting:  » Causal Modeling  » Market Modeling  » Ship to Share |  For Students