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

You can look at the data step that PROC EXPORT writes but I don't think it will create a file with an LRECL > 32767 perhaps you could edit the program.

 

This data step works for 20,000 variables I'm still waiting the job to start with 2M variables.  The calculation for LRECL in the program is a bit arbitrary so you will need to think about that a bit.  You just want to make sure the you don't FLOWOVER.   You can set the value arbitrarily high and but that will just cost you more memory.

 

%let n=2000000;
data M2;
   length ID $16.;
   array val[&n] (1:&n);
   do _n_ = 1 to 4;
      id = put(_n_,z16.);
      output;
      end;
   run;

filename m2 '~/m2.csv' lrecl=%sysevalF(16*&n);

data _null_;
   set m2;
   file m2 dsd;
   if _n_ eq 1 then link _names_;
   put (_all_)(:);
   return;
 _names_:
   length _name_ $32;
   do while(1);
      call vnext(_name_);
      if _name_ eq '_name_' then leave;
      put _name_ @;
      end;
   put;
   return;
   run;
MajaFerencakovic
Fluorite | Level 6
This one is also correct! I really hope this will help people doing genetics to prepare data for outdated softwares and programers who don't understand that they really should start to work on improvements of their procedures because we are getting more and more data everyday
Tom
Super User Tom
Super User

Just replace your PROC EXPORT with a data step to write the header.

 

filename snp  "C:\Users\Maja\Desktop\gv50.csv";

data _null_ ;
  file snp dsd lrecl=10000000 ;
  put 'id' @;
  do i=1 to 2000000;
    name = cats('snp',i);
    put name @;
  end;
  put;
run;

data _null_ ;
  file snp dsd lrecl=10000000 mod ;
  set bikovi;
  put ( id snp1-snp2000000 ) (+0) ;
run;

 

(or do it in the other data step)

 

MajaFerencakovic
Fluorite | Level 6
This one works perfectly! Thanks!

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 connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 18 replies
  • 3485 views
  • 7 likes
  • 8 in conversation