<?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: array problem in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/array-problem/m-p/595320#M15782</link>
    <description>&lt;P&gt;Thanks a lot for the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try to run this program it give a sorted data set (seems like)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering if its OK that I can email you to discuss some SAS problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it's possible then i will finish this discussion. Again, Thanks a lot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Oct 2019 11:02:11 GMT</pubDate>
    <dc:creator>gkpf</dc:creator>
    <dc:date>2019-10-10T11:02:11Z</dc:date>
    <item>
      <title>array problem</title>
      <link>https://communities.sas.com/t5/New-SAS-User/array-problem/m-p/595297#M15770</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA=MYLIB.FILTER_FOR_FLT_WT t2;

array flt_id {249} S_Fri_BR3303_SJCTPE S_Fri_BR3304_TPESJC S_Fri_BR3309_SJCTPE



DO n=1 TO 3;
PROC SQL;
CREATE TABLE MYLIB.FILTER_FOR_MER05 AS 
SELECT t1.Wt_Knw_Ind, 
t1.Pax_key, 
t1.Bag_Cnt, 
t1.Bag_Wt_Msr, 
t1.Unit_Qual_Cd, 
t1.Pool_Ind, 
t1.Pax_Prm_Id, 
t1.Pty_Rk, 
t1.Flt_Id, 
t1.Age, 
t1.Horscp_Nm, 
t1.Nat_Cd, 
t1.Emp_Ind, 
t1.Pax_Typ_Cd, 
t1.Gndr_Cd, 
t1.Title_Cd, 
t1.Tvl_Seq, 
t1.Seg_Id, 
t1.Grp_Ind, 
t1.Obd_Cbn_Cls_Cd, 
t1.Seat_Nbr, 
t1.Trf_Ind, 
t1.Ffp_Carr_Cd, 
t1.Ffp_Typ_Cd, 
t1.Brdg_Stat_Desc
FROM MYLIB.MER05 t1
WHERE t1.Wt_Knw_Ind = flt_id{n};


QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hi, I have a problem&amp;nbsp; with sas array value problem, i try to use several ways to get the value call flt_id (which tells the different flight)&lt;/P&gt;&lt;P&gt;and I try to seperate the data with tons of passenger&amp;nbsp; by the flt_id, but i cant access the array value and it keep showing&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, !, !!, &amp;amp;, (, *, **, +, -, '.', /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, AND, EQ, EQT,&lt;BR /&gt;EXCEPT, GE, GET, GROUP, GT, GTT, HAVING, INTERSECT, LE, LET, LT, LTT, NE, NET, NOT, OR, ORDER, OUTER, UNION, ^, ^=,&lt;BR /&gt;|, ||, ~, ~=.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have try different syntax like ( ), [ ] but is not working at all, plz help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(By the way, I'm using SAS EG, and is there an easier way to automatically seperate the data with different flt_id? )&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 09:44:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/array-problem/m-p/595297#M15770</guid>
      <dc:creator>gkpf</dc:creator>
      <dc:date>2019-10-10T09:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: array problem</title>
      <link>https://communities.sas.com/t5/New-SAS-User/array-problem/m-p/595309#M15776</link>
      <description>&lt;P&gt;You cannot "nest" data and procedure steps. As soon as the SAS interpreter detects&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;it sees the step boundary of the data step, which is incomplete at that time, and that causes your ERROR.&lt;/P&gt;
&lt;P&gt;Aside from the missing semicolon to end the array statement, and the fact that you define the array with 249 elements, but only supply three variable names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What are you trying to achieve? Please supply example data in usable form (data steps with datalines) to illustrate your issue.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 10:35:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/array-problem/m-p/595309#M15776</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-10-10T10:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: array problem</title>
      <link>https://communities.sas.com/t5/New-SAS-User/array-problem/m-p/595313#M15778</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;What I have is a data set of passenger and each individual has&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;pax_key(which tells who they are)&lt;/P&gt;&lt;P&gt;flt_id(which flight they took)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so what i try to do is I want to seperate the data by flt_id so that i can analysis the correlation of fuel_cost and other data they give us&lt;/P&gt;&lt;P&gt;(&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;S_Fri_BR3303_SJCTPE has one data set of its passenger&lt;/P&gt;&lt;P&gt;S_Fri_BR3304_TPESJC has another one&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So sorry about my previous question, I'm so lost in SAS programming&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 10:45:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/array-problem/m-p/595313#M15778</guid>
      <dc:creator>gkpf</dc:creator>
      <dc:date>2019-10-10T10:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: array problem</title>
      <link>https://communities.sas.com/t5/New-SAS-User/array-problem/m-p/595317#M15780</link>
      <description>&lt;P&gt;Since SAS always allows group processing, there is no need to separate datasets.&lt;/P&gt;
&lt;P&gt;Do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
CREATE TABLE MYLIB.FILTER_FOR_MER05 AS 
SELECT t1.Wt_Knw_Ind, 
t1.Pax_key, 
t1.Bag_Cnt, 
t1.Bag_Wt_Msr, 
t1.Unit_Qual_Cd, 
t1.Pool_Ind, 
t1.Pax_Prm_Id, 
t1.Pty_Rk, 
t1.Flt_Id, 
t1.Age, 
t1.Horscp_Nm, 
t1.Nat_Cd, 
t1.Emp_Ind, 
t1.Pax_Typ_Cd, 
t1.Gndr_Cd, 
t1.Title_Cd, 
t1.Tvl_Seq, 
t1.Seg_Id, 
t1.Grp_Ind, 
t1.Obd_Cbn_Cls_Cd, 
t1.Seat_Nbr, 
t1.Trf_Ind, 
t1.Ffp_Carr_Cd, 
t1.Ffp_Typ_Cd, 
t1.Brdg_Stat_Desc
FROM MYLIB.MER05 t1
WHERE t1.Wt_Knw_Ind in ("S_Fri_BR3303_SJCTPE","S_Fri_BR3304_TPESJC","S_Fri_BR3309_SJCTPE")
order by t1.Wt_Knw_Ind, pax_key;

QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Oct 2019 10:51:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/array-problem/m-p/595317#M15780</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-10-10T10:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: array problem</title>
      <link>https://communities.sas.com/t5/New-SAS-User/array-problem/m-p/595320#M15782</link>
      <description>&lt;P&gt;Thanks a lot for the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try to run this program it give a sorted data set (seems like)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering if its OK that I can email you to discuss some SAS problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it's possible then i will finish this discussion. Again, Thanks a lot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 11:02:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/array-problem/m-p/595320#M15782</guid>
      <dc:creator>gkpf</dc:creator>
      <dc:date>2019-10-10T11:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: array problem</title>
      <link>https://communities.sas.com/t5/New-SAS-User/array-problem/m-p/595331#M15785</link>
      <description>&lt;P&gt;Yes, the dataset is sorted by flight and pax_key. That way, you can use BY in SAS procedures to automatically group your analysis, and avoid splitting into multiple datasets.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 11:30:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/array-problem/m-p/595331#M15785</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-10-10T11:30:16Z</dc:date>
    </item>
  </channel>
</rss>

