DATA Step, Macro, Functions and more

reading CSV file

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

reading CSV file

Dear Members

 

I am trying to read in a CSV file with 74 variables. Dataset creation was successful and I dont see any error/warning in the log.  Created dataset has correct values until variable 8. From variable 9 onwards values start repeating from variable 1 instead of having value for variable 9. Does anyone know why is it?

 

Sample code is given below

 

filename bio "/xxx/bio.csv";

 

data bio1;
     infile bio MISSOVER DSD lrecl=32767 firstobs=2;
  informat USUBJID $200.;
  informat CANTYPE $200.;
  informat Visit $200.;
  informat Cohort $200.;
  informat STATUS $200.;
  informat AKTS473 $200.;
  informat AKTT308 $200.;
  informat GSK3AB $200.;
  informat PTEN $200.;
  informat MTOR $200.;
  informat P70S6 $200.;
  informat MEK1 $200.;
  informat ERK12 $200.;
  informat P38MAPK $200.;
  informat CREB $200.;
  informat JNK $200.;
  informat CJUN $200.;
  informat HER2 $200.;
  informat IGF1R $200.;
  informat SRC $200.;
  informat SMAD2 $200.;
  informat ZAP70 $200.;
  informat BTK $200.;
  informat IKBA $200.;
  informat CTACK $200.;
  informat EOTAXIN $200.;
  informat GCSF $200.;
  informat GMCSF $200.;
  informat GROA $200.;
  informat ICAM1 $200.;
  informat INTLK8 $200.;
  informat IP10 $200.;
  informat MCP1 $200.;
  informat MCP3 $200.;
  informat MIG $200.;
  informat MIP1A $200.;
  informat MIP1B $200.;
  informat RANTES $200.;
  informat SDF1A $200.;
  informat VCAM1 $200.;
  informat VEGF $200.;
  informat INTLK1A $200.;
  informat INTLK16 $200.;
  informat INTLK17 $200.;
  informat INTLK18 $200.;
  informat INTLK1B $200.;
  informat INTLK6 $200.;
  informat MIF $200.;
  informat TNFA $200.;
  informat TNFB $200.;
  informat INTLK10 $200.;
  informat INTLK13 $200.;
  informat INTLK1RA $200.;
  informat INTLK4 $200.;
  informat BNGF $200.;
  informat FGFBF $200.;
  informat HGF $200.;
  informat IFNA2 $200.;
  informat IFNG $200.;
  informat INTLK127 $200.;
  informat INTLK124 $200.;
  informat INTLK15 $200.;
  informat INTLK2 $200.;
  informat INTLK2RA $200.;
  informat INTLK3 $200.;
  informat INTLK5 $200.;
  informat INTLK7 $200.;
  informat INTLK9 $200.;
  informat LIF $200.;
  informat MCSF $200.;
  informat PDGFBB $200.;
  informat SCF $200.;
  informat SCGFB $200.;
  informat TRAIL $200.;
           
  format USUBJID $200.;
  format CANTYPE $200.;
  format Visit $200.;
  format Cohort $200.;
  format STATUS $200.;
  format AKTS473 $200.;
  format AKTT308 $200.;
  format GSK3AB $200.;
  format PTEN $200.;
  format MTOR $200.;
  format P70S6 $200.;
  format MEK1 $200.;
  format ERK12 $200.;
  format P38MAPK $200.;
  format CREB $200.;
  format JNK $200.;
  format CJUN $200.;
  format HER2 $200.;
  format IGF1R $200.;
  format SRC $200.;
  format SMAD2 $200.;
  format ZAP70 $200.;
  format BTK $200.;
  format IKBA $200.;
  format CTACK $200.;
  format EOTAXIN $200.;
  format GCSF $200.;
  format GMCSF $200.;
  format GROA $200.;
  format ICAM1 $200.;
  format INTLK8 $200.;
  format IP10 $200.;
  format MCP1 $200.;
  format MCP3 $200.;
  format MIG $200.;
  format MIP1A $200.;
  format MIP1B $200.;
  format RANTES $200.;
  format SDF1A $200.;
  format VCAM1 $200.;
  format VEGF $200.;
  format INTLK1A $200.;
  format INTLK16 $200.;
  format INTLK17 $200.;
  format INTLK18 $200.;
  format INTLK1B $200.;
  format INTLK6 $200.;
  format MIF $200.;
  format TNFA $200.;
  format TNFB $200.;
  format INTLK10 $200.;
  format INTLK13 $200.;
  format INTLK1RA $200.;
  format INTLK4 $200.;
  format BNGF $200.;
  format FGFBF $200.;
  format HGF $200.;
  format IFNA2 $200.;
  format IFNG $200.;
  format INTLK127 $200.;
  format INTLK124 $200.;
  format INTLK15 $200.;
  format INTLK2 $200.;
  format INTLK2RA $200.;
  format INTLK3 $200.;
  format INTLK5 $200.;
  format INTLK7 $200.;
  format INTLK9 $200.;
  format LIF $200.;
  format MCSF $200.;
  format PDGFBB $200.;
  format SCF $200.;
  format SCGFB $200.;
  format TRAIL $200.;
       
     
     input
     USUBJID $
  CANTYPE $
  Visit $
  Cohort $
  STATUS $
  AKTS473 $
  AKTT308 $
  GSK3AB $
  PTEN $
  MTOR $
  P70S6 $
  MEK1 $2
  ERK12 $
  P38MAPK $
  CREB $
  JNK $
  CJUN $
  HER2 $
  IGF1R $
  SRC $
  SMAD2 $
  ZAP70 $
  BTK $
  IKBA $
  CTACK $
  EOTAXIN $
  GCSF $
  GMCSF $
  GROA $
  ICAM1 $
  INTLK8 $
  IP10 $
  MCP1 $
  MCP3 $
  MIG $
  MIP1A $
  MIP1B $
  RANTES $
  SDF1A $
  VCAM1 $
  VEGF $
  INTLK1A $
  INTLK16 $
  INTLK17 $
  INTLK18 $
  INTLK1B $
  INTLK6 $
  MIF $
  TNFA $
  TNFB $
  INTLK10 $
  INTLK13 $
  INTLK1RA $
  INTLK4 $
  BNGF $
  FGFBF $
  HGF $
  IFNA2 $
  IFNG $
  INTLK127 $
  INTLK124 $
  INTLK15 $
  INTLK2 $
  INTLK2RA $
  INTLK3 $
  INTLK5 $
  INTLK7 $
  INTLK9 $
  LIF $
  MCSF $
  PDGFBB $
  SCF $
  SCGFB $
  TRAIL $
     ;
run;


Accepted Solutions
Solution
‎10-05-2016 03:49 PM
New Contributor
Posts: 2

Re: reading CSV file

Never mind..I figured it out

View solution in original post


All Replies
Solution
‎10-05-2016 03:49 PM
New Contributor
Posts: 2

Re: reading CSV file

Never mind..I figured it out

Super User
Posts: 19,789

Re: reading CSV file

@Deepak22 Please mark the question as solved, if you're successfully resolved your issue.

Super User
Posts: 11,343

Re: reading CSV file

Please post the resolution. Others may have a similar issue and be led to this forum from some search. It will be helpful if those future users can see what you actually did to resolve the problem to see if it matches their problem.

Super User
Posts: 11,343

Re: reading CSV file

You would have to supply some example lines from the source file to allow diagnosis.

 

I will say that having so many variables all with length 200 makes be suspect that there is something a bit odd. If you used Proc Import to generate the datastep what was your Guessingrows value.

 

You may also want the TRUNCOVER or MISSOVER option on your infile statement.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 286 views
  • 1 like
  • 3 in conversation