<?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: Linking GVKEY and IID in Compustat dataset ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Linking-GVKEY-and-IID-in-Compustat-dataset/m-p/722546#M224062</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sample;
 set import.qgorvcptbfwuowrm5;
 	id1=catx('_',gvkey,iid);  /*add quotation mark, combine variables with _*/
	id2=cats(gvkey,iid);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 01 Mar 2021 08:48:37 GMT</pubDate>
    <dc:creator>blueskyxyz</dc:creator>
    <dc:date>2021-03-01T08:48:37Z</dc:date>
    <item>
      <title>Linking GVKEY and IID in Compustat dataset ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Linking-GVKEY-and-IID-in-Compustat-dataset/m-p/722527#M224050</link>
      <description>&lt;P&gt;Hi SAS Users,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When collecting data from Compustat, one GVKEY (company) can have multiple IID (issue identifier) , so &lt;A href="https://documentation.sas.com/?docsetId=etsug&amp;amp;docsetTarget=etsug_sasexccm_details04.htm&amp;amp;docsetVersion=v_003&amp;amp;locale=en" target="_self"&gt;this SAS document&lt;/A&gt; suggests that these two identifiers must be accessed as a pair to properly identify a Compustat security.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In SAS, &lt;A href="https://support.sas.com/rnd/app/ets/interface_engine/SASEXCCM.html" target="_self"&gt;this SAS document&lt;/A&gt; says that SAS provides GVIIDKEY=option&amp;nbsp;&lt;SPAN&gt;to provide access to Compustat securities through the composite key designated by "GVKEY.IID". &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;However, in my case, I have the data already with GVKEY and IID in separate columns. Can I ask what I should do to generate a GVKEY.IID in my current dataset based on the above idea?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I also attach my data in the attached file, here is a quick description&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;GVKEY	IID	DATADATE	PRCHD
001166	01W	04JAN1999	4.6000
001166	01W	05JAN1999	4.6000
001166	01W	06JAN1999	5.0000
001166	01W	07JAN1999	4.9000
001166	01W	08JAN1999	5.6000
001166	01W	11JAN1999	5.5000
001166	01W	12JAN1999	5.6000&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;While GVKEY and IID are character variables, the other two variables are numeric variables&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;One idea popping up in my mind is just to create a new variable named, but I am not confident if I understand the idea of GVIIDKEY correctly.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;gvkey_iid=catx(_,GVKEY,IID)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Apart from that, when I run this code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname import 'E:\Harv 27th_Feb_2021\global_daily_1999_2001' access=readonly;

/*Creating gvkeyiid var*/
data sample;
 set import.qgorvcptbfwuowrm5;
 	gvkeyiid=catx(_,gvkey,iid);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The log announced a note as below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;30         /*Creating gvkeyiid var*/
31         data sample;
32          set import.qgorvcptbfwuowrm5;
33          	gvkeyiid=catx(_,gvkey,iid);
34         run;

NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).
      33:17   
NOTE: Variable _ is uninitialized.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Could you please tell me how to solve it as well?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Warmest regards!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 05:33:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Linking-GVKEY-and-IID-in-Compustat-dataset/m-p/722527#M224050</guid>
      <dc:creator>Phil_NZ</dc:creator>
      <dc:date>2021-03-01T05:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Linking GVKEY and IID in Compustat dataset ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Linking-GVKEY-and-IID-in-Compustat-dataset/m-p/722545#M224061</link>
      <description>30         /*Creating gvkeyiid var*/&lt;BR /&gt;31         data sample;&lt;BR /&gt;32          set import.qgorvcptbfwuowrm5;&lt;BR /&gt;33          	id1=catx('_',gvkey,iid);&lt;BR /&gt;                id2=cats(gvkey,iid);&lt;BR /&gt;34         run;</description>
      <pubDate>Mon, 01 Mar 2021 08:45:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Linking-GVKEY-and-IID-in-Compustat-dataset/m-p/722545#M224061</guid>
      <dc:creator>blueskyxyz</dc:creator>
      <dc:date>2021-03-01T08:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Linking GVKEY and IID in Compustat dataset ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Linking-GVKEY-and-IID-in-Compustat-dataset/m-p/722546#M224062</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sample;
 set import.qgorvcptbfwuowrm5;
 	id1=catx('_',gvkey,iid);  /*add quotation mark, combine variables with _*/
	id2=cats(gvkey,iid);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Mar 2021 08:48:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Linking-GVKEY-and-IID-in-Compustat-dataset/m-p/722546#M224062</guid>
      <dc:creator>blueskyxyz</dc:creator>
      <dc:date>2021-03-01T08:48:37Z</dc:date>
    </item>
  </channel>
</rss>

