<?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: From PostgreSQL to SAS proq sql in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471088#M120624</link>
    <description>&lt;P&gt;It is in this from ' *AA123BB' and with the SAS expression&amp;nbsp;compress(identificativo_veicolo_denuncian,'* ') it becomes&lt;/P&gt;&lt;P&gt;'&lt;SPAN&gt;AA123BB'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Same applies to&amp;nbsp;identificativo_veicolo_contropar. I need the MIN and MAX function to store in two different variables the MIN and MAX (alphabetically) the two strings.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jun 2018 14:07:17 GMT</pubDate>
    <dc:creator>Marco_park</dc:creator>
    <dc:date>2018-06-18T14:07:17Z</dc:date>
    <item>
      <title>From PostgreSQL to SAS proq sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471061#M120613</link>
      <description>&lt;P&gt;Hi everyone, I am trying to convert a postgresql in proc sas.&lt;/P&gt;&lt;P&gt;I need these main functions available in postgresql least, greatest and regexp_replace.&lt;/P&gt;&lt;P&gt;How do they translate in SAS?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 13:21:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471061#M120613</guid>
      <dc:creator>Marco_park</dc:creator>
      <dc:date>2018-06-18T13:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: From PostgreSQL to SAS proq sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471075#M120614</link>
      <description>&lt;P&gt;Its a good idea to review the manual on SAS's implementation of ANSI SQL.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Least is most likely to be min()&lt;/P&gt;
&lt;P&gt;Greatest is most likely to be max()&lt;/P&gt;
&lt;P&gt;regexp_replace could be a number of different things, for example tranwrd() function.&amp;nbsp; Perl regex is also available in SAS:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/rnd/base/datastep/perl_regexp/regexp-tip-sheet.pdf" target="_blank"&gt;https://support.sas.com/rnd/base/datastep/perl_regexp/regexp-tip-sheet.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might also find it simpler coding if you learn some Base SAS and use that rather than SQL, for instance min/max can be done in proc means, summary, or datastep.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 13:51:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471075#M120614</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-18T13:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: From PostgreSQL to SAS proq sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471078#M120617</link>
      <description>&lt;P&gt;Thank you, I used compress for REGEXP_REPLACE,&amp;nbsp;and I have tried MIN and MAX, however MIN and MAX require numeric inputs, what if I have character strings?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 13:54:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471078#M120617</guid>
      <dc:creator>Marco_park</dc:creator>
      <dc:date>2018-06-18T13:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: From PostgreSQL to SAS proq sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471079#M120618</link>
      <description>&lt;P&gt;Why would you store numbers in character variables?&amp;nbsp; Anyways:&lt;/P&gt;
&lt;PRE&gt;...
  min(input(char_variable,best.)) as min_result
...&lt;/PRE&gt;
&lt;P&gt;Use the input to convert char to number, and put to convert numeric to char.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 13:55:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471079#M120618</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-18T13:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: From PostgreSQL to SAS proq sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471084#M120621</link>
      <description>&lt;P&gt;I have tried the following&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;min(input(char_variable1,best.),input(char_variable2,best.)) as min_result&lt;/PRE&gt;&lt;P&gt;However I have errors. The code I am trying to convert is the following&lt;/P&gt;&lt;PRE&gt; LEAST(REGEXP_REPLACE(REGEXP_REPLACE(identificativo_veicolo_denuncian,'\*',''),' ',''),REGEXP_REPLACE(REGEXP_REPLACE(identificativo_veicolo_contropar,'\*',''),' ','') ) AS targa1,
 GREATEST(REGEXP_REPLACE(REGEXP_REPLACE(identificativo_veicolo_denuncian,'\*',''),' ',''),REGEXP_REPLACE(REGEXP_REPLACE(identificativo_veicolo_contropar,'\*',''),' ','') ) AS targa2,&lt;/PRE&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 14:00:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471084#M120621</guid>
      <dc:creator>Marco_park</dc:creator>
      <dc:date>2018-06-18T14:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: From PostgreSQL to SAS proq sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471086#M120622</link>
      <description>&lt;P&gt;You are using regex statement to process some character data into a numeric type.&amp;nbsp; I need to see some example of what the data looks like before.&amp;nbsp; So what does&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;identificativo_veicolo_denuncian&lt;/PRE&gt;
&lt;P&gt;Contain, what does it look like?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 14:04:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471086#M120622</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-18T14:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: From PostgreSQL to SAS proq sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471088#M120624</link>
      <description>&lt;P&gt;It is in this from ' *AA123BB' and with the SAS expression&amp;nbsp;compress(identificativo_veicolo_denuncian,'* ') it becomes&lt;/P&gt;&lt;P&gt;'&lt;SPAN&gt;AA123BB'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Same applies to&amp;nbsp;identificativo_veicolo_contropar. I need the MIN and MAX function to store in two different variables the MIN and MAX (alphabetically) the two strings.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 14:07:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471088#M120624</guid>
      <dc:creator>Marco_park</dc:creator>
      <dc:date>2018-06-18T14:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: From PostgreSQL to SAS proq sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471091#M120626</link>
      <description>&lt;P&gt;Ok, so:&lt;/P&gt;
&lt;PRE&gt;min(input(compress(&lt;SPAN&gt;identificativo_veicolo_denuncian," ","kd"),best.)) as want&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;So the compress, I remove blanks, and I use the options k = keep, d = digits, to keep only the numbers in the string, then I convert number and min().&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 14:11:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471091#M120626</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-18T14:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: From PostgreSQL to SAS proq sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471093#M120628</link>
      <description>&lt;P&gt;Thank you very much,&lt;/P&gt;&lt;P&gt;the thing is that for each row I need the min of the two variables&amp;nbsp;identificativo_veicolo_contropar and&amp;nbsp;identificativo_veicolo_denuncian. in PostgreSQL this could be done with the instruction LEAST(VAR1,VAR2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I do this?&lt;/P&gt;&lt;P&gt;Can I be achieved as?&lt;/P&gt;&lt;PRE&gt;min(input(compress(identificativo_veicolo_denuncian," ","kd"),best.),input(compress(identificativo_veicolo_contropar," ","kd"),best.)) as targa1,&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 14:16:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471093#M120628</guid>
      <dc:creator>Marco_park</dc:creator>
      <dc:date>2018-06-18T14:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: From PostgreSQL to SAS proq sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471100#M120631</link>
      <description>&lt;P&gt;Yes, min() function is a SAS function which can take a list of numeric values and return the minimum.&amp;nbsp; The min() from SQL min's a column of data, so you can use either and the compiled is clever enough to know which one.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 14:28:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471100#M120631</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-18T14:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: From PostgreSQL to SAS proq sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471103#M120633</link>
      <description>&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My final query looks like this one&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc sql;
CREATE TABLE prova AS
SELECT DISTINCT data_sinistro, identificativo_veicolo,
			 min(input(compress(identificativo_veicolo_denuncian," ","kd"),best.),input(compress(identificativo_veicolo_contropar," ","kd"),best.)) as targa1,
             max(input(compress(identificativo_veicolo_denuncian," ","kd"),best.),input(compress(identificativo_veicolo_contropar," ","kd"),best.)) AS targa2,
             CASE WHEN ruolo_veicolo_richiesto = 'D' THEN 'D'
             ELSE 'C' END AS ruolo_veicolo_richiesto,
             'NO_CARD' AS tipo
             FROM Ssrc
			 WHERE calculated targa1 NOT IN ('','ZZ999ZZ',  'ZZ999XX',  'ZZ99999',  'ZZ000ZZ',  'XXXXXX',   'AA00000',  'AA000AA',  'AA000BB',  'AA000XX',  'AA11111', 'AA000ZZ', 'AA111BB', 'XX000XX', 'ELIMINAT', 'XX999XX', 'XX111XX', 'XX123XX',  'MI111111', 'PLPENPLP', 'XX000YY', 'RMZ94732', 'AA111AA', 'AA123BB', 'BS400BZ', 'KASKO', 'RCDIV','VARIE','TRASP','PEDONE','MOTVEL','FURTOT','FURTOP','IGNOTO','INCEND','FURTOR','AGG.TO','ESTERA','FURTOL')
             AND calculated targa2 NOT IN ('','ZZ999ZZ',  'ZZ999XX',  'ZZ99999',  'ZZ000ZZ',  'XXXXXX',   'AA00000',  'AA000AA',  'AA000BB',  'AA000XX',  'AA11111', 'AA000ZZ', 'AA111BB', 'XX000XX', 'ELIMINAT', 'XX999XX', 'XX111XX', 'XX123XX',  'MI111111', 'PLPENPLP', 'XX000YY', 'RMZ94732', 'AA111AA', 'AA123BB', 'BS400BZ', 'KASKO', 'RCDIV','VARIE','TRASP','PEDONE','MOTVEL','FURTOT','FURTOP','IGNOTO','INCEND','FURTOR','AGG.TO','ESTERA','FURTOL')
			 AND data_sinistro is not missing
;
quit;&lt;/PRE&gt;&lt;P&gt;but, unfortunately it returns the error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ERROR: Expression using IN has components that are of different data types.
ERROR: Expression using IN has components that are of different data types.&lt;/PRE&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 14:32:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471103#M120633</guid>
      <dc:creator>Marco_park</dc:creator>
      <dc:date>2018-06-18T14:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: From PostgreSQL to SAS proq sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471111#M120636</link>
      <description>&lt;P&gt;You are comparing apples to bananas:&lt;/P&gt;
&lt;PRE&gt;min(input(compress(identificativo_veicolo_denuncian," ","kd"),best.),input(compress(identificativo_veicolo_contropar," ","kd"),best.)) as targa1,&lt;/PRE&gt;
&lt;P&gt;This returns a number which is the minimum of the two converted text fields.&amp;nbsp; It will be a number or missing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;WHERE calculated targa1 NOT IN ('','ZZ999ZZ',  'ZZ999XX',  'ZZ99999',  'ZZ000ZZ',  'XXXXXX',   'AA00000',  'AA000AA',  'AA000BB',  'AA000XX',  'AA11111', 'AA000ZZ', 'AA111BB', 'XX000XX', 'ELIMINAT', 'XX999XX', 'XX111XX', 'XX123XX',  'MI111111', 'PLPENPLP', 'XX000YY', 'RMZ94732', 'AA111AA', 'AA123BB', 'BS400BZ', 'KASKO', 'RCDIV','VARIE','TRASP','PEDONE','MOTVEL','FURTOT','FURTOP','IGNOTO','INCEND','FURTOR','AGG.TO','ESTERA','FURTOL')&lt;/PRE&gt;
&lt;P&gt;This is comparing the numeric value of targa1 as defined previously, with a set of character strings, something that can't be done, and doesn't make sense anyway.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Say you two character variables are:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;AA123BB&amp;nbsp; &amp;nbsp;and&amp;nbsp;&amp;nbsp;BA345BB&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We calculate targa1 as 123, as remove all the character data, then the minimum is 123 which is &amp;lt; 345.&amp;nbsp; So the numeric variable targa1=123.&amp;nbsp; Then we say is 123 in (characters), which is a fail as you don't compare numbers to characters.&amp;nbsp; It is also a fail as 123 is never going to be in that list of text strings even if convert the number to character again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you might want (and again, flying completely blind here):&lt;/P&gt;
&lt;PRE&gt;WHERE identificativo_veicolo_denuncian NOT IN ('','ZZ999ZZ',  'ZZ999XX',  'ZZ99999',  'ZZ000ZZ',  'XXXXXX',   'AA00000',  'AA000AA',  'AA000BB',  'AA000XX',  'AA11111', 'AA000ZZ', 'AA111BB', 'XX000XX', 'ELIMINAT', 'XX999XX', 'XX111XX', 'XX123XX',  'MI111111', 'PLPENPLP', 'XX000YY', 'RMZ94732', 'AA111AA', 'AA123BB', 'BS400BZ', 'KASKO', 'RCDIV','VARIE','TRASP','PEDONE','MOTVEL','FURTOT','FURTOP','IGNOTO','INCEND','FURTOR','AGG.TO','ESTERA','FURTOL')&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Jun 2018 14:47:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471111#M120636</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-18T14:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: From PostgreSQL to SAS proq sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471115#M120639</link>
      <description>&lt;P&gt;Thank you very much for your help. I have found a solution that seems to be working as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;SELECT DISTINCT data_sinistro, identificativo_veicolo,
             ifc(compress(identificativo_veicolo_denuncian,"* ")&amp;lt;compress(identificativo_veicolo_contropar,"* "),compress(identificativo_veicolo_denuncian,"* "),compress(identificativo_veicolo_contropar,"* ")) as targa1,
             ifc(compress(identificativo_veicolo_denuncian,"* ")&amp;gt;compress(identificativo_veicolo_contropar,"* "),compress(identificativo_veicolo_denuncian,"* "),compress(identificativo_veicolo_contropar,"* ")) as targa2,
             CASE WHEN ruolo_veicolo_richiesto = 'D' THEN 'D'
             ELSE 'C' END AS ruolo_veicolo_richiesto,
             'NO_CARD' AS tipo
             FROM Ssrc
             WHERE calculated targa1 NOT IN ('','ZZ999ZZ',  'ZZ999XX',  'ZZ99999',  'ZZ000ZZ',  'XXXXXX',   'AA00000',  'AA000AA',  'AA000BB',  'AA000XX',  'AA11111', 'AA000ZZ', 'AA111BB', 'XX000XX', 'ELIMINAT', 'XX999XX', 'XX111XX', 'XX123XX',  'MI111111', 'PLPENPLP', 'XX000YY', 'RMZ94732', 'AA111AA', 'AA123BB', 'BS400BZ', 'KASKO', 'RCDIV','VARIE','TRASP','PEDONE','MOTVEL','FURTOT','FURTOP','IGNOTO','INCEND','FURTOR','AGG.TO','ESTERA','FURTOL')
             AND calculated targa2 NOT IN ('','ZZ999ZZ',  'ZZ999XX',  'ZZ99999',  'ZZ000ZZ',  'XXXXXX',   'AA00000',  'AA000AA',  'AA000BB',  'AA000XX',  'AA11111', 'AA000ZZ', 'AA111BB', 'XX000XX', 'ELIMINAT', 'XX999XX', 'XX111XX', 'XX123XX',  'MI111111', 'PLPENPLP', 'XX000YY', 'RMZ94732', 'AA111AA', 'AA123BB', 'BS400BZ', 'KASKO', 'RCDIV','VARIE','TRASP','PEDONE','MOTVEL','FURTOT','FURTOP','IGNOTO','INCEND','FURTOR','AGG.TO','ESTERA','FURTOL')
	     AND data_sinistro is not missing);&lt;/PRE&gt;&lt;P&gt;Now one last step.&lt;/P&gt;&lt;P&gt;In PostgreSQL I would run the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;CREATE TABLE prova AS
SELECT DISTINCT ON (data_sinistro, identificativo_veicolo, targa1, targa2)
data_sinistro, identificativo_veicolo, targa1, targa2, ruolo_veicolo_richiesto, tipo
  FROM (****)&lt;/PRE&gt;&lt;P&gt;Where the **** represents the block of code previously written. This codes eliminates duplicates based on this three fields only&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(data_sinistro, identificativo_veicolo, targa1, targa2)&lt;/PRE&gt;&lt;P&gt;Keeping all the variables&lt;/P&gt;&lt;PRE&gt;data_sinistro, identificativo_veicolo, targa1, targa2, ruolo_veicolo_richiesto, tipo&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;In the final table.&lt;/P&gt;&lt;P&gt;Is there something similar in SAS?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much indeed for your help&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 14:53:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471115#M120639</guid>
      <dc:creator>Marco_park</dc:creator>
      <dc:date>2018-06-18T14:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: From PostgreSQL to SAS proq sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471169#M120657</link>
      <description>&lt;P&gt;No, they don't in PROC SQL. Try it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/216207"&gt;@Marco_park&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you, I used compress for REGEXP_REPLACE,&amp;nbsp;and I have tried MIN and MAX, however MIN and MAX require numeric inputs, what if I have character strings?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 17:21:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/From-PostgreSQL-to-SAS-proq-sql/m-p/471169#M120657</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-06-18T17:21:23Z</dc:date>
    </item>
  </channel>
</rss>

