BookmarkSubscribeRSS Feed
Phil0917
Fluorite | Level 6

Hi Everyone,

  I am trying to import a CSV file into SAS using an INFILE / INPUT in a data step, however, there is a special character that cuts off the import after 34,121 records (there are over 190,000 records in the source data.  The special character is a right-arrow symbol.  If I manually remove this symbol from the source file before importing, it works fine.  Is there a way to programmatically get around  manually removing these symbols?  I am using SAS v9.1.3 in a Windows environment.  Here is the data step code that I am using:

data QALL                                        ;

     infile '\\kcifile\ORX\ORXNBCVO-NBCVOT\Data\Archive\Import\Query_test.csv' delimiter = ',' MISSOVER DSD lrecl=32767 firstobs=2 TERMSTR=CRLF;

        informat Country $500. ;

        informat Site_ID $389. ;

        informat Site $212. ;

        informat Patient_Identity $157. ;

        informat Patient_Status $133. ;

        informat _DCF_Status $64. ;

        informat Sent_Date $24. ;

       informat Answered_Date $22. ;

        informat Answered_By $31. ;

        informat Closed_Date mmddyy10. ;

        informat Closed_By $33. ;

        informat DCF_Key best32. ;

       informat Query_Name $35. ;

       informat Created_By_Name $31. ;

        informat Created_By_Group $23. ;

        informat Event_Label $39. ;

       informat Event_Date mmddyy10. ;

         informat Form_Label $65. ;

       informat Query_Description $500. ;

         informat Action_Request $1000. ;

        informat Answer $482. ;

         informat Days_Since_Sent best32. ;

        format Country $500. ;

        format Site_ID $389. ;

        format Site $212. ;

        format Patient_Identity $157. ;

        format Patient_Status $133. ;

        format _DCF_Status $64. ;

        format Sent_Date $24. ;

         format Answered_Date $22. ;

        format Answered_By $31. ;

        format Closed_Date mmddyy10. ;

         format Closed_By $33. ;

        format DCF_Key best12. ;

        format Query_Name $35. ;

        format Created_By_Name $31. ;

         format Created_By_Group $23. ;

        format Event_Label $39. ;

        format Event_Date mmddyy10. ;

         format Form_Label $65. ;

        format Query_Description $500. ;

        format Action_Request $1000. ;

         format Answer $482. ;

        format Days_Since_Sent best32. ;

      input

                 Country $

                 Site_ID $

                  Site $

                  Patient_Identity $

                  Patient_Status $

                  _DCF_Status $

                 Sent_Date $

                 Answered_Date $

                 Answered_By $

                  Closed_Date

                 Closed_By $

                  DCF_Key

                  Query_Name $

                  Created_By_Name $

                 Created_By_Group $

                 Event_Label $

                 Event_Date

                  Form_Label $

                  Query_Description $

                  Action_Request $

                  Answer $

                 Days_Since_Sent

     ;

      run;

Thanks in advance!!

-Phil

2 REPLIES 2
Phil0917
Fluorite | Level 6

Hi Tom,

  Thanks so much!!  That worked perfectly!! Smiley Happy

Thanks!

-Phil

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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