Merging array

  • Follow


Hi

I want to convert
[1 2;3 4;5 6]
to [1 2 3 4 5 6]
Without using a loop

Thanks
0
Reply pleh (16) 2/22/2007 8:47:22 AM

Hi,

X=[1 2;3 4;5 6]

X([1 4 2 5 3 6])
%or
reshape(X',1,[])
%or
X=X';
X(:)'

J�r�me
0
Reply dutmatlab (3796) 2/22/2007 9:12:11 AM


Summary: Merge information
#iw-value=1

Sharad,

There are basically two ways to match records in SAS.

   1) DATA step MERGE with BY statement
   2) SQL join with conditions of when records match

Either is designed to take any fixed set of variables for a particular
matching.  The BY statement requires that the variables in it be in both
data sets.

Sometimes one can construct variables to match on.  In difficult situations
one can do a series of matches and then put the data together.

In the nastiest cases one can construct the variables with statistical
procedures that indicate a high probability of matching on some collection
of information and then match those records.

It is far from clear exactly what you need.  In terms of understanding the
basic DATA step merge I would suggest looking at

[PDF]
How to Think Through the SAS� DATA Step
File Format: PDF/Adobe Acrobat
How to Think Through the SAS� DATA Step. Ian Whitlock, Kennett Square, PA.
Abstract. You are relatively new to SAS and interested in writing SAS code.
....
www2.sas.com/proceedings/sugi31/246-31.pdf - Similar pages

[PDF]
A SAS Programmer's View of the SAS Supervisor
File Format: PDF/Adobe Acrobat - View as HTML
Ian Whitlock, Westat Inc. Abstract. This tutorial answers questions like:.
�. As a DATA step programmer, what do I need to. know about the SAS
supervisor ...
www2.sas.com/proceedings/sugi22/ADVTUTOR/PAPER34.PDF - Similar pages

To find more papers on merges and SQL try http://lexjansen.com/sugi/
It is an excellent tool for searching for SAS papers.

Ian Whitlock
==============

Date:         Mon, 18 Jun 2007 20:35:45 -0700
Reply-To:     sharad <sharadoffline@GMAIL.COM>
Sender:       "SAS(r) Discussion"
From:         sharad <sharadoffline@GMAIL.COM>
Organization: http://groups.google.com
Subject:      Merging
Comments: To: sas-l
Content-Type: text/plain; charset="iso-8859-1"

Hi All,

I am trying to match merge two data files but there is no single primary
key(Unique Variable) on the basis of which i can merge the files. I don't
know whether i can use 2 or more variables for creating a pimary key and
then using that primary key for merging. If this can be done, then please
help me out with the pocess. I will be vey happy if someone can explain me
the concept of merging, i mean...... how SAS compile and execute MERGE
Statement. Please help me at the earliest. Sharad
0
Reply iw1junk (1195) 6/19/2007 1:50:34 PM

2 Replies
35 Views

(page loaded in 0.076 seconds)

Similiar Articles:













7/15/2012 1:20:25 PM


Reply: