<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to convert a matrix data into a column vector (data set) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256366#M49129</link>
    <description>&lt;P&gt;"&lt;SPAN&gt;so that it could read .xlsx files directly instead of .txt or .csv (otherwise I have to copy and paste data to a .txt or .csv file. I want to avoid this step). I have tried the following infile statements but only fist (and .csv) working. I want .xlsx extention."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I don't understand what you mean. That is what I just did. If you want output be a EXCEL file , just add one more proc export at end of my code.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME REFFILE "/folders/myfolders/Matrix.xlsx" ;

PROC IMPORT DATAFILE=REFFILE DBMS=XLSX OUT=IMPORT replace;
	GETNAMES=NO; 
RUN;


data _null_;
 set sashelp.vcolumn(where=(libname='WORK' and memname='IMPORT')) end=last;
if _n_ eq 1 then call execute('proc sql;create table want as');
if type='num' then call execute(cat('select put(',name,',best.) as ',name,'from IMPORT'));
 else call execute(cat('select ',name,' from IMPORT'));
if not last then call execute('union all');
 else call execute(';quit;');
run;


proc export data=want outfile="/folders/myfolders/want.xlsx" dbms=xlsx replace;
putnames=no;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 13 Mar 2016 02:14:32 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-03-13T02:14:32Z</dc:date>
    <item>
      <title>How to convert a matrix data into a column vector (data set)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/252127#M47779</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;BR /&gt;*(Please see two attachments first for data and my objective);&lt;BR /&gt;&lt;BR /&gt;options nocenter nonumber;
libname abc '/folders/myfolders';

FILENAME REFFILE "/folders/myfolders/Matrix.xlsx" TERMSTR=CR;

PROC IMPORT DATAFILE=REFFILE DBMS=XLSX OUT=abc.IMPORT;
	GETNAMES=NO;
RUN;

*var abc.import = colvec(abc.import);

PROC print DATA=abc.IMPORT noobs;
RUN;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Feb 2016 18:33:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/252127#M47779</guid>
      <dc:creator>AG_Stats</dc:creator>
      <dc:date>2016-02-24T18:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a matrix data into a column vector (data set)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/252272#M47851</link>
      <description>&lt;P&gt;You want IML code ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME REFFILE "/folders/myfolders/Matrix.xlsx" TERMSTR=CR;

PROC IMPORT DATAFILE=REFFILE DBMS=XLSX OUT=IMPORT replace;
	GETNAMES=NO; 
RUN;

data _null_;
 set sashelp.vcolumn(where=(libname='WORK' and memname='IMPORT')) end=last;
if _n_ eq 1 then call execute('proc sql;create table want as');
if type='num' then call execute(cat('select put(',name,',best.) as ',name,'from IMPORT'));
 else call execute(cat('select ',name,' from IMPORT'));
if not last then call execute('union all');
 else call execute(';quit;');
run;

proc print;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Feb 2016 02:03:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/252272#M47851</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-02-25T02:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a matrix data into a column vector (data set)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/252307#M47861</link>
      <description>Thanks Ksharp,&lt;BR /&gt;&lt;BR /&gt;I get what I need. However, I have started working on SAS just two weeks before, I don't know what is IML code. However, I have searched on google to understand it.&lt;BR /&gt;&lt;BR /&gt;Dose IML code will do something better. Would it improve my programming or does it make my coding short?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Ankit Gulati</description>
      <pubDate>Thu, 25 Feb 2016 07:02:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/252307#M47861</guid>
      <dc:creator>AG_Stats</dc:creator>
      <dc:date>2016-02-25T07:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a matrix data into a column vector (data set)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/252309#M47862</link>
      <description>&lt;P&gt;IML is another sas language , unlike classic data step. The unit it operate is a matrix . Which could get you very fast . But are hard to handle big data due to the need of loading all data into memory.&lt;/P&gt;
&lt;P&gt;IML stands for Interactive Matrix Language.&lt;/P&gt;
&lt;P&gt;For learning it , Check Rick's blog :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/iml/" target="_blank"&gt;http://blogs.sas.com/content/iml/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2016 07:09:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/252309#M47862</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-02-25T07:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a matrix data into a column vector (data set)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/252423#M47895</link>
      <description>Thanks Ksharp.&lt;BR /&gt;&lt;BR /&gt;##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##</description>
      <pubDate>Thu, 25 Feb 2016 16:41:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/252423#M47895</guid>
      <dc:creator>AG_Stats</dc:creator>
      <dc:date>2016-02-25T16:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a matrix data into a column vector (data set)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256314#M49101</link>
      <description>&lt;P&gt;Hi Ksharp,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For my last matrix to column vector question I found I more very easy solution. However I appreciate your 'proc sql' logic.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data vect2;
	infile "/folders/myfolders/Matrix/Matrix1.txt" dsd dlm= '	';
		do count = 1 to 2000; /* Giving a big value (Even Bigger than total No. of observations) */
		input X @; drop count; /* Or: input X $ @; */
		output;
	end;
run;&lt;BR /&gt;&lt;BR /&gt;ods csv file = '/folders/myfolders/Matrix/Mat_to_Vec2.csv';&lt;BR /&gt;proc print noobs;&lt;BR /&gt;run;&lt;BR /&gt;ods csv close;&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It's very simple.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ankit&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2016 19:10:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256314#M49101</guid>
      <dc:creator>AG_Stats</dc:creator>
      <dc:date>2016-03-12T19:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a matrix data into a column vector (data set)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256320#M49106</link>
      <description>&lt;P&gt;Hi Kshrap,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regarding the same reply could you modify the above code so that it could read .xlsx files directly instead of .txt or .csv (otherwise I have to copy and paste data to a .txt or .csv file. I want to avoid this step). I have tried the following infile statements but only fist (and .csv) working. I want .xlsx extention.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, please give me 'ods xlsx' or similar statement to get print / output in an excel (.xlsx) file. (However, I know that I can use right click and choose export option and export 'work.vect2' to an excel file. But I want a code/statement for this.)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;FILENAME REFFILE "/folders/myfolders/Matrix/Matrix1.xlsx" TERMSTR=CR;

PROC IMPORT DATAFILE=REFFILE DBMS=XLSX OUT=IMPORT replace;
	GETNAMES=NO; 
RUN;

data vect2;
	infile "/folders/myfolders/Matrix/Matrix1.txt" dsd dlm= '	';
	*infile reffile dsd dlm= '	';
	*infile REFFILE;
	*infile "/folders/myfolders/Matrix/Matrix1.xlsx" termstr=cr dsd dlm= '	';
	do count = 1 to 5000; /* Giving a big value (Even Bigger than total No. of observations) */
		input X @; drop count; /* Or: input X $ @; */
		output;
	end;
run;&lt;/PRE&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ankit&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2016 20:20:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256320#M49106</guid>
      <dc:creator>AG_Stats</dc:creator>
      <dc:date>2016-03-12T20:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a matrix data into a column vector (data set)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256330#M49113</link>
      <description>&lt;P&gt;Hi Kshrap,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regarding the same reply could you modify the above code so that it could read .xlsx files directly instead of .txt or .csv (otherwise I have to copy and paste data to a .txt or .csv file. I want to avoid this step). I have tried the following infile statements but only fist (and .csv) working. I want .xlsx extention.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, please give me 'ods xlsx' or similar statement to get print / output in an excel (.xlsx) file. (However, I know that I can use right click and choose export option and export 'work.vect2' to an excel file. But I want a code/statement for this.)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME REFFILE "/folders/myfolders/Matrix/Matrix1.xlsx" TERMSTR=CR;

PROC IMPORT DATAFILE=REFFILE DBMS=XLSX OUT=IMPORT replace;
	GETNAMES=NO; 
RUN;

data vect2;
	infile "/folders/myfolders/Matrix/Matrix1.txt" dsd dlm= '	';
	*infile reffile dsd dlm= '	';
	*infile REFFILE;
	*infile "/folders/myfolders/Matrix/Matrix1.xlsx" termstr=cr dsd dlm= '	';
	do count = 1 to 5000; /* Giving a big value (Even Bigger than total No. of observations) */
		input X @; drop count; /* Or: input X $ @; */
		output;
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ankit&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2016 20:23:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256330#M49113</guid>
      <dc:creator>AG_Stats</dc:creator>
      <dc:date>2016-03-12T20:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a matrix data into a column vector (data set)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256366#M49129</link>
      <description>&lt;P&gt;"&lt;SPAN&gt;so that it could read .xlsx files directly instead of .txt or .csv (otherwise I have to copy and paste data to a .txt or .csv file. I want to avoid this step). I have tried the following infile statements but only fist (and .csv) working. I want .xlsx extention."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I don't understand what you mean. That is what I just did. If you want output be a EXCEL file , just add one more proc export at end of my code.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME REFFILE "/folders/myfolders/Matrix.xlsx" ;

PROC IMPORT DATAFILE=REFFILE DBMS=XLSX OUT=IMPORT replace;
	GETNAMES=NO; 
RUN;


data _null_;
 set sashelp.vcolumn(where=(libname='WORK' and memname='IMPORT')) end=last;
if _n_ eq 1 then call execute('proc sql;create table want as');
if type='num' then call execute(cat('select put(',name,',best.) as ',name,'from IMPORT'));
 else call execute(cat('select ',name,' from IMPORT'));
if not last then call execute('union all');
 else call execute(';quit;');
run;


proc export data=want outfile="/folders/myfolders/want.xlsx" dbms=xlsx replace;
putnames=no;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 13 Mar 2016 02:14:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256366#M49129</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-03-13T02:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a matrix data into a column vector (data set)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256380#M49136</link>
      <description>&lt;P&gt;Hi Kshrap,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry I have not mentioned my Objective this time.&lt;/P&gt;&lt;P&gt;Now I have a matrix as:&lt;/P&gt;&lt;P&gt;1 4 7&lt;/P&gt;&lt;P&gt;2 5 8&lt;/P&gt;&lt;P&gt;3 6 9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I want otuput&amp;nbsp;as:&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;7&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also&amp;nbsp;I want to take input from .xlsx file and output to .xlsx file; by using the following codes:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data vect2;&lt;BR /&gt; infile "/folders/myfolders/Matrix.xlsx" dsd; /* something is wrong here. */&lt;BR /&gt; &lt;BR /&gt; do count = 1 to 50; &lt;BR /&gt; input X @; drop count;&lt;BR /&gt; output;&lt;BR /&gt; end;&lt;BR /&gt;run;&lt;BR /&gt;
/* and output in excel file */&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(And sorry, this coding is not a short-cut of your proc sql. &amp;nbsp;It was my misunderstanding.)&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ankit&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2016 05:47:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256380#M49136</guid>
      <dc:creator>AG_Stats</dc:creator>
      <dc:date>2016-03-13T05:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a matrix data into a column vector (data set)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256381#M49137</link>
      <description>&lt;P&gt;Hi Kshrap,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry I have not mentioned my Objective this time.&lt;/P&gt;&lt;P&gt;Now I have a matrix as:&lt;/P&gt;&lt;P&gt;1 4 7&lt;/P&gt;&lt;P&gt;2 5 8&lt;/P&gt;&lt;P&gt;3 6 9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I want otuput&amp;nbsp;as:&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;P&gt;7&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also&amp;nbsp;I want to take input from .xlsx file and output to .xlsx file; by using the following codes:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data vect2;&lt;BR /&gt; infile "/folders/myfolders/Matrix.xlsx" dsd; /* something is wrong here. */&lt;BR /&gt; &lt;BR /&gt; do count = 1 to 50; &lt;BR /&gt; input X @; drop count;&lt;BR /&gt; output;&lt;BR /&gt; end;&lt;BR /&gt;run;&lt;BR /&gt;
/* and output in excel file */&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(And sorry, this coding is not a short-cut of your proc sql. &amp;nbsp;It was my misunderstanding.)&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ankit&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2016 05:47:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256381#M49137</guid>
      <dc:creator>AG_Stats</dc:creator>
      <dc:date>2016-03-13T05:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a matrix data into a column vector (data set)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256409#M49138</link>
      <description>&lt;P&gt;OK.This could be simple as :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME REFFILE "/folders/myfolders/Matrix.xlsx" ;

PROC IMPORT DATAFILE=REFFILE DBMS=XLSX OUT=IMPORT replace;
	GETNAMES=NO; 
RUN;

data IMPORT ;
 set IMPORT ;
 _n+1;
run;
proc transpose data=IMPORT out=want(where=(_name_ ne '_n'));
by _n;
var _all_;
run;


proc export data=want(keep=col1) outfile="/folders/myfolders/want.xlsx" dbms=xlsx replace;
putnames=no;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 13 Mar 2016 09:35:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256409#M49138</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-03-13T09:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a matrix data into a column vector (data set)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256415#M49140</link>
      <description>&lt;P&gt;Thanks Kshrap,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I get how to use proc export to export the sas data set. But I still do not know how to import .xlsx file in this particular program.)&lt;/P&gt;&lt;P&gt;Could you modify the following program, so that instead of importing raw data from .csv file I can import it from .xlsx file.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
/*
FILENAME REFFILE "/folders/myfolders/Matrix.xlsx" ;

PROC IMPORT DATAFILE=REFFILE DBMS=XLSX OUT=IMPORT replace;
	GETNAMES=NO; 
RUN;
*/

data vect2;
*set import; 
	infile "/folders/myfolders/Matrix.csv" dsd;  
	do count = 1 to 50;  
	input X @; *drop count; 
	output; 
	end;
run;

proc export data=vect2(drop=count) outfile="/folders/myfolders/want6.xlsx" dbms=xlsx replace;
putnames=no;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 13 Mar 2016 10:43:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256415#M49140</guid>
      <dc:creator>AG_Stats</dc:creator>
      <dc:date>2016-03-13T10:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a matrix data into a column vector (data set)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256464#M49157</link>
      <description>&lt;P&gt;I don't understand what you mean.&lt;/P&gt;
&lt;P&gt;If you really want use data step , you can transform the dataset into CSV file ,then import it by data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME REFFILE "/folders/myfolders/Matrix.xlsx" ;

PROC IMPORT DATAFILE=REFFILE DBMS=XLSX OUT=IMPORT replace;
	GETNAMES=NO; 
RUN;

proc export data=IMPORT outfile="/folders/myfolders/Matrix.csv" dbms=csv replace;
putnames=no;
run;

data vect2;
	infile "/folders/myfolders/Matrix.csv" dsd;  
	input X @@; 
run;

proc export data=vect2 outfile="/folders/myfolders/want6.xlsx" dbms=xlsx replace;
putnames=no;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Mar 2016 00:48:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256464#M49157</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-03-14T00:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a matrix data into a column vector (data set)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256482#M49164</link>
      <description>&lt;P&gt;Okay, Kshrap, I get it.&lt;/P&gt;&lt;P&gt;But still there are questions in my mind.&lt;/P&gt;&lt;P&gt;Q1. Could we save our steps in this program. Can we avoid step 2. Can we directly read .xlsx file in step 3 (as we are reading .csv file here)?&lt;/P&gt;&lt;P&gt;Q2. Could we combine Step 1 and Step 2 in one step (or could we do anything new)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ankit&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Step 1 */
FILENAME REFFILE "/folders/myfolders/Matrix.xlsx" ;

PROC IMPORT DATAFILE=REFFILE DBMS=XLSX OUT=IMPORT replace;
	GETNAMES=NO; 
RUN;

/* Step 2 */
proc export data=IMPORT outfile="/folders/myfolders/Matrix.csv" dbms=csv replace;
putnames=no;
run;

/* Step 3 */
data vect2;
	infile "/folders/myfolders/Matrix.csv" dsd;  
	input X @@; 
run;

/* Step 4 */
proc export data=vect2 outfile="/folders/myfolders/want6.xlsx" dbms=xlsx replace;
putnames=no;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Mar 2016 04:46:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256482#M49164</guid>
      <dc:creator>AG_Stats</dc:creator>
      <dc:date>2016-03-14T04:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a matrix data into a column vector (data set)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256490#M49165</link>
      <description>&lt;P&gt;Q1. Could we save our steps in this program. Can we avoid step 2. Can we directly read .xlsx file in step 3 (as we are reading .csv file here)?&lt;/P&gt;
&lt;P&gt;No. You can't avoid Step2 unless you use my last code(operate it in SAS dataset).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No.You can't&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;directly read .xlsx file in step 3 unless you want to use DDE skill ,but that is too old skill .&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Q2. Could we combine Step 1 and Step 2 in one step (or could we do anything new)?&lt;/P&gt;
&lt;P&gt;No. I don't konw how to combine them , Use my last code or Use LIBNAME x XLSX&amp;nbsp;"/folders/myfolders/Matrix.xlsx" ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2016 06:59:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256490#M49165</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-03-14T06:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a matrix data into a column vector (data set)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256495#M49166</link>
      <description>&lt;P&gt;Thanks Kshrap,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, I could not understand how to use:&amp;nbsp;&lt;SPAN&gt;LIBNAME x XLSX&amp;nbsp;"/folders/myfolders/Matrix.xlsx" ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Could you rectify the following codes:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(I am getting the following error:&amp;nbsp;ERROR: No logical assign for filename RD.)&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;LIBNAME rd XLSX "/folders/myfolders/Matrix.xlsx";

data vect2;
	  
	infile rd;
	input X @@; 
run;

proc export data=vect2 outfile="/folders/myfolders/want6.xlsx" dbms=xlsx replace;
putnames=no;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Mar 2016 07:58:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256495#M49166</guid>
      <dc:creator>AG_Stats</dc:creator>
      <dc:date>2016-03-14T07:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a matrix data into a column vector (data set)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256496#M49167</link>
      <description>&lt;P&gt;&lt;SPAN&gt;LIBNAME x XLSX&amp;nbsp;"/folders/myfolders/Matrix.xlsx" ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;is the same as&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;PROC IMPORT DATAFILE=REFFILE DBMS=XLSX OUT=IMPORT replace;&lt;BR /&gt; GETNAMES=NO; &lt;BR /&gt;RUN;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So you can operate the table like this. But I don't think that is what you want.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;LIBNAME x XLSX&amp;nbsp;"/folders/myfolders/Matrix.xlsx" ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;data IMPORT ;&lt;BR /&gt; set x.'Sheet1$'n;&lt;BR /&gt; _n+1;&lt;BR /&gt;run;&lt;BR /&gt;proc transpose data=IMPORT out=want(where=(_name_ ne '_n'));&lt;BR /&gt;by _n;&lt;BR /&gt;var _all_;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc export data=want(keep=col1) outfile="/folders/myfolders/want.xlsx" dbms=xlsx replace;&lt;BR /&gt;putnames=no;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;According to your requirment, Check DDE skill, but I don't familiar with it . Ask other people.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2016 08:13:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256496#M49167</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-03-14T08:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a matrix data into a column vector (data set)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256529#M49170</link>
      <description>&lt;P&gt;Thanks Kshrap,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have learned many things from you. But still I have&amp;nbsp;a doubt in last code and I will discuss it after 20th March.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ankit&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2016 11:19:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/256529#M49170</guid>
      <dc:creator>AG_Stats</dc:creator>
      <dc:date>2016-03-14T11:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a matrix data into a column vector (data set)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/263499#M51570</link>
      <description>&lt;P&gt;Hi Kshrap,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to run your last codes. But unfortunately I am getting 2 errors:&lt;/P&gt;&lt;P&gt;I have runned this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;LIBNAME x XLSX "/folders/myfolders/Matrix.xlsx" ;&lt;/P&gt;&lt;P&gt;data IMPORT ;&lt;BR /&gt;set x.'Sheet1$'n;&lt;BR /&gt;_n+1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then see the log(s):&lt;/P&gt;&lt;DIV class="sasSource"&gt;/*&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;55&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;56&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;57 LIBNAME x XLSX "/folders/myfolders/Matrix.xlsx" ;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Libref X was successfully assigned as follows:&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Engine: XLSX&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Physical Name: /folders/myfolders/Matrix.xlsx&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;58&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;59 data IMPORT ;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;60 set x.'Sheet1$'n;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&lt;STRONG&gt;ERROR: Couldn't find range or sheet in spreadsheet&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&lt;STRONG&gt;ERROR: File X.'Sheet1$'n.DATA does not exist.&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;61 _n+1;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;62 run;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;&lt;STRONG&gt;WARNING: The data set WORK.IMPORT may be incomplete. When this step was stopped there were 0 observations and 1 variables.&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.07 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.01 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;*/&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Note: I ensure you that the required excel file is at right location and has required sheet viz. sheet1. Also, I am using SAS Studio v3.4 or 3.5.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;*****************************************************************************************************************************************************************&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Besides this, if I want to read Sheet1 and Sheet2 of a (Excel) file for different purpose then is there any shortcut to save steps. Till I used to do it as:&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;For example, for simplicity, my aim is to print the output dataset (sheet1 and sheet2):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&lt;BR /&gt;FILENAME ago "/folders/myfolders/Learning/Matrix.xlsx" TERMSTR=CR;&lt;BR /&gt;&lt;BR /&gt;PROC IMPORT DATAFILE=ago&lt;BR /&gt;DBMS=XLSX&lt;BR /&gt;OUT=WORK.IMPORT10;&lt;BR /&gt;GETNAMES=No;&lt;BR /&gt;SHEET="Sheet1";&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;proc print data= import10 noobs; run;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&lt;DIV class="sasNote"&gt;&lt;BR /&gt;FILENAME ago "/folders/myfolders/Learning/Matrix.xlsx" TERMSTR=CR;&lt;BR /&gt;&lt;BR /&gt;PROC IMPORT DATAFILE=ago&lt;BR /&gt;DBMS=XLSX&lt;BR /&gt;OUT=WORK.IMPORT11;&lt;BR /&gt;GETNAMES=yes;&lt;BR /&gt;SHEET="Sheet2";&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;proc print data= import11 noobs; run;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Note: Here, I am using GETNAMES option = no for sheet1 and then yes for sheet2.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;1. However, for simplicity you can assume it as yes for both cases.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;2. Also, consider the same problem (give me shortcut steps) if this option is no for sheet1 and yes for sheet2.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Also note that if I do it as:&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&lt;BR /&gt;LIBNAME x XLSX "/folders/myfolders/Matrix.xlsx" ;&lt;BR /&gt;&lt;BR /&gt;proc print data= x.'sheet2$'n;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;Then I am getting the same error for print procedure. (Libname statement is fine).&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&lt;STRONG&gt;(I am waiting for your reply)&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&lt;STRONG&gt;Thanks&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&lt;STRONG&gt;Ankit&lt;/STRONG&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 13 Apr 2016 13:21:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-matrix-data-into-a-column-vector-data-set/m-p/263499#M51570</guid>
      <dc:creator>AG_Stats</dc:creator>
      <dc:date>2016-04-13T13:21:22Z</dc:date>
    </item>
  </channel>
</rss>

