<?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: Call SymputX Issue in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Call-SymputX-Issue/m-p/75219#M16201</link>
    <description>I am not a macro expert but I believe the problem might be that when you use "call symputx" you cannot use the same macro within the data step.  You might need to use a couple of  data _NULL_ steps and make sure you end them with run;</description>
    <pubDate>Wed, 14 Apr 2010 14:10:08 GMT</pubDate>
    <dc:creator>RickM</dc:creator>
    <dc:date>2010-04-14T14:10:08Z</dc:date>
    <item>
      <title>Call SymputX Issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-SymputX-Issue/m-p/75217#M16199</link>
      <description>Hello,&lt;BR /&gt;
In the following code, the macro-variables :&lt;BR /&gt;
Annee, Mois, Periode and FicOk have no value affected at the first run of the code.&lt;BR /&gt;
&lt;BR /&gt;
Annee, Mois, Periode are affected at the second run and FicOk at the third time.&lt;BR /&gt;
&lt;BR /&gt;
How could I do to make the programme run at the first time ?&lt;BR /&gt;
&lt;BR /&gt;
Thanks.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
%Macro CreeTableMensuelle(MyTableRef, MyLibIn, MyTableOut, MyAnnee, MyMois, MyPeriode);&lt;BR /&gt;
	%Global PrefD;&lt;BR /&gt;
	%Global PrefC;&lt;BR /&gt;
	%Global PostRep;&lt;BR /&gt;
&lt;BR /&gt;
	%Global stRep;&lt;BR /&gt;
	%Global stFichier;&lt;BR /&gt;
&lt;BR /&gt;
	%Global Annee;&lt;BR /&gt;
	%Global Mois;&lt;BR /&gt;
	%Global Periode;&lt;BR /&gt;
	%Global FicOk;&lt;BR /&gt;
&lt;BR /&gt;
	%Global Nom;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
	/* Préfixe pour tables de données : Les tables s'appellent D_ suivi du nom du fichier d'origine */&lt;BR /&gt;
	%Let PrefD=D_;&lt;BR /&gt;
&lt;BR /&gt;
	/* Préfixe pour table de tests de contraintes */&lt;BR /&gt;
	%let prefC=C_;&lt;BR /&gt;
&lt;BR /&gt;
	/* PostFixe pour répertoire de tables à traiter (nom de la feuille de l'arborescence) */&lt;BR /&gt;
	%Let PostRep=A_TRAITER;&lt;BR /&gt;
&lt;BR /&gt;
	/* On parcourt la table MyTableRef */&lt;BR /&gt;
	Data _NULL_;&lt;BR /&gt;
		Set &amp;amp;MyTableRef;&lt;BR /&gt;
&lt;BR /&gt;
		/* Si l'enregistrement courant présente les bonnes condition alors on ajoute */&lt;BR /&gt;
		/* Le fichier qu'il désigne à MyTableOut */&lt;BR /&gt;
		Call SymputX('Annee',input(Annee,best.));&lt;BR /&gt;
		Call SymputX('Mois',input(Mois,best.));&lt;BR /&gt;
		Call SymputX('Periode',Periode);&lt;BR /&gt;
		Call SymputX('FicOk',input(FicOk,best.));&lt;BR /&gt;
&lt;BR /&gt;
		%If &amp;amp;Annee eq &amp;amp;MyAnnee and &amp;amp;Mois eq &amp;amp;MyMois and &amp;amp;Periode eq &amp;amp;MyPeriode and &amp;amp;FicOk eq 1 %Then %Do;&lt;BR /&gt;
&lt;BR /&gt;
			/* Constitution du répertoire physique où se situe la table */&lt;BR /&gt;
			/* des données à intégrer à la table mensuelle des données */&lt;BR /&gt;
			%If &amp;amp;MyPeriode eq A %Then %Let stRep=&amp;amp;MyLibIn.\&amp;amp;MyAnnee.\&amp;amp;MyMois.\ANNUEL;&lt;BR /&gt;
			%If &amp;amp;MyPeriode eq M %Then %Let stRep=&amp;amp;MyLibIn.\&amp;amp;MyAnnee.\&amp;amp;MyMois.\MENSUEL;&lt;BR /&gt;
&lt;BR /&gt;
			Libname LibSrc "&amp;amp;stRep.\&amp;amp;PostRep";&lt;BR /&gt;
			%put &amp;amp;stRep.\&amp;amp;PostRep;&lt;BR /&gt;
&lt;BR /&gt;
			/* Nom de la table à intégrer */&lt;BR /&gt;
			Call SymputX('Nom',Fichier);&lt;BR /&gt;
			%Let stFichier=&amp;amp;PrefD.&amp;amp;Nom;&lt;BR /&gt;
			%put MyTableRef = &amp;amp;MyTableRef - stFichier = &amp;amp;stFichier;&lt;BR /&gt;
&lt;BR /&gt;
			/* Ajout de la table à MyTableOut */&lt;BR /&gt;
			%IntegreTable(LibSrc.&amp;amp;StFichier,&amp;amp;MyTableOut);&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
			/* Constitution du nom de la table des tests à intégrer à la table mensuelle des tests */&lt;BR /&gt;
			&lt;BR /&gt;
		%End;&lt;BR /&gt;
&lt;BR /&gt;
	Run;&lt;BR /&gt;
%Mend;</description>
      <pubDate>Wed, 14 Apr 2010 07:27:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-SymputX-Issue/m-p/75217#M16199</guid>
      <dc:creator>phil27</dc:creator>
      <dc:date>2010-04-14T07:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Call SymputX Issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-SymputX-Issue/m-p/75218#M16200</link>
      <description>The SAS program you shared is invoking a SAS macro which you have not provided in your post, that is IntegreTabl.&lt;BR /&gt;
&lt;BR /&gt;
Also, you are mixing SAS macro language and DATA step CALL SYMPUTX - the CALL function creates SAS global macro variables but it occurs during DATA step execution and not SAS macro compilation, normally.&lt;BR /&gt;
&lt;BR /&gt;
And, you have a SAS LIBNAME statement in the middle of what appears to be a DATA step execution.&lt;BR /&gt;
&lt;BR /&gt;
You must create SAS global macro variables using %LET statements, before the macro CreeTableMensuelle is executed.&lt;BR /&gt;
&lt;BR /&gt;
Below, you will find a suggested SAS support website search argument, which will generate some links for your review and reading on this subject-matter.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic/post:&lt;BR /&gt;
&lt;BR /&gt;
macro variable focus symput global site:sas.com</description>
      <pubDate>Wed, 14 Apr 2010 14:06:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-SymputX-Issue/m-p/75218#M16200</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-04-14T14:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: Call SymputX Issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-SymputX-Issue/m-p/75219#M16201</link>
      <description>I am not a macro expert but I believe the problem might be that when you use "call symputx" you cannot use the same macro within the data step.  You might need to use a couple of  data _NULL_ steps and make sure you end them with run;</description>
      <pubDate>Wed, 14 Apr 2010 14:10:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-SymputX-Issue/m-p/75219#M16201</guid>
      <dc:creator>RickM</dc:creator>
      <dc:date>2010-04-14T14:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: Call SymputX Issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-SymputX-Issue/m-p/75220#M16202</link>
      <description>Thank you for your answers.&lt;BR /&gt;
I will have a look at this.&lt;BR /&gt;
&lt;BR /&gt;
Phil.</description>
      <pubDate>Wed, 14 Apr 2010 14:39:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-SymputX-Issue/m-p/75220#M16202</guid>
      <dc:creator>phil27</dc:creator>
      <dc:date>2010-04-14T14:39:47Z</dc:date>
    </item>
  </channel>
</rss>

