Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7030015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:36:54+00:00 2026-05-28T00:36:54+00:00

My input file is in CSV but I have 2 problems here 1. My

  • 0

My input file is in “CSV” but I have 2 problems here

1. My variable name start in line3 , how can I write the code to start reading name from line3 and take value from line4 ?

2. acct_num has some typo ( space , – dash ) this force error in the process, so I couldn’t get the file import to sasdataset. ( I know I do this in sasdataset , but not sure how can I get this import to SAS)

PROC IMPORT DATAFILE="c:\temp\bad.csv" OUT=table1 DBMS=CSV REPLACE;
    GETNAMES=YES;
    DATAROW=2;
RUN;

line1   Title_name  
line2       
line3   acct_name   acct_num
line4   A          12345
line5   B          12    345
line6   C          12-345
line7   D          1234
line8   E          123

SAS dummy

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:36:54+00:00Added an answer on May 28, 2026 at 12:36 am

    I couldn’t get the import to do what you wanted, maybe another answer will help with PROC IMPORT….however, you can use an INFILE statement. This solution assumes you know your variable names.

    Assuming your file looks something like this:

    title_name
    
    acct_name,acct_num
    A,12345
    B,12    345
    C,12-345
    D,1234
    E,123
    

    the below code will start reading on line 4.

    filename csv "C:\Documents and Settings\jsc\Desktop\csv_infile.csv";
    
    data Work.temp;
    
     infile csv dlm=',' dsd missover lrecl=1000 firstobs=4;
     input acct_name $ acct_num $ ;
    
     <code to fix any values in acct_name or acct_num, if any>
    
    run;
    

    Update your question with additional questions if this is an acceptable solution and you need help maninpulating the data that is read in.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web page where it will input an excel/CSV file from the
I have written a program which reads input from csv file and its working
I get an input CSV file that I have to upload to my oracle
My SSIS program reads as input from a .csv file. The file has about
Say I have an input file, and a target directory. How do I determine
I have an XML input file and I'm trying to output the result of
I have an input file that I want to sort based on timestamp which
When reading data from the Input file I noticed that the ¥ symbom was
I need to delete my input file securely once I have finished with it,
I wanna stop the reading of my text input file when the word synonyms

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.