From: RolandRB on
On Aug 3, 2:48 pm, Uelsasser <UlrichElsas...(a)t-online.de> wrote:
> On 31 Jul., 10:57, RolandRB <rolandbe...(a)hotmail.com> wrote:
>
> > On Jul 31, 10:37 am, francogrex <fra...(a)grex-removethis.com> wrote:
>
> > > RolandRB wrote:
> > > >What happens when you run this sas code on Windows 7?
> > > >%macro env2ds(dsout);...<snip>
>
> > > Yes it does work on windows xp (sas v9), it creates a set called _env2ds
> > > and as expected contains 2 columns of the env variable names and values;
> > > nice.
>
> > Thanks. I know it works on Windows XP. It is whether it works on
> > Windows 7 either 32 bit or 64 bit I need to know.
>
> Hi Roland
>
> it does not work on WINDOWS 7 / 32 bit , SAS V9.2
> The log reads
>
> NOTE: The infile _ENV2DS is:
>       Unnamed Pipe Access Device,
>       PROCESS=set,RECFM=V,LRECL=256
>
> Stderr output:
> Das Handle ist ung ltig.
> Das Handle ist ung ltig.
> Das Handle ist ung ltig.
> Das Handle ist ung ltig.
> Das Handle ist ung ltig.
> ..........

Hi Uli, this should work on Windows 7. It is annoying that unnamed
pipes do not work on Windows 7. This gets around it by writing to a
temporary file. I don't know of a simple method of working out if you
are on Windows 7 but if I did it would not be made part of the macro
below in any case.


%macro env2dsw7(dsout);

%if not %length(&dsout) %then %let dsout=_env2ds;

x 'set > C:\Windows\Temp\_env2dsw7.tmp';

filename _env2ds 'C:\Windows\Temp\_env2dsw7.tmp';

data &dsout;
length name $ 40 value $ 1000;
infile _env2ds;
input;
name=scan(_infile_,1,"=");
value=substr(_infile_,index(_infile_,"=")+1);
label name="Environment Variable Name"
value="Environment Variable Value"
;
run;

filename _env2ds clear;
run;

x 'del C:\Windows\Temp\_env2dsw7.tmp';
run;

%mend;

%env2dsw7;
From: RolandRB on
On Aug 6, 10:39 am, RolandRB <rolandbe...(a)hotmail.com> wrote:
> On Aug 3, 2:48 pm, Uelsasser <UlrichElsas...(a)t-online.de> wrote:
>
>
>
> > On 31 Jul., 10:57, RolandRB <rolandbe...(a)hotmail.com> wrote:
>
> > > On Jul 31, 10:37 am, francogrex <fra...(a)grex-removethis.com> wrote:
>
> > > > RolandRB wrote:
> > > > >What happens when you run this sas code on Windows 7?
> > > > >%macro env2ds(dsout);...<snip>
>
> > > > Yes it does work on windows xp (sas v9), it creates a set called _env2ds
> > > > and as expected contains 2 columns of the env variable names and values;
> > > > nice.
>
> > > Thanks. I know it works on Windows XP. It is whether it works on
> > > Windows 7 either 32 bit or 64 bit I need to know.
>
> > Hi Roland
>
> > it does not work on WINDOWS 7 / 32 bit , SAS V9.2
> > The log reads
>
> > NOTE: The infile _ENV2DS is:
> >       Unnamed Pipe Access Device,
> >       PROCESS=set,RECFM=V,LRECL=256
>
> > Stderr output:
> > Das Handle ist ung ltig.
> > Das Handle ist ung ltig.
> > Das Handle ist ung ltig.
> > Das Handle ist ung ltig.
> > Das Handle ist ung ltig.
> > ..........
>
> Hi Uli, this should work on Windows 7. It is annoying that unnamed
> pipes do not work on Windows 7. This gets around it by writing to a
> temporary file. I don't know of a simple method of working out if you
> are on Windows 7 but if I did it would not be made part of the macro
> below in any case.
>
> %macro env2dsw7(dsout);
>
>   %if not %length(&dsout) %then %let dsout=_env2ds;
>
>   x 'set > C:\Windows\Temp\_env2dsw7.tmp';
>
>   filename _env2ds 'C:\Windows\Temp\_env2dsw7.tmp';
>
>   data &dsout;
>     length name $ 40 value $ 1000;
>     infile _env2ds;
>     input;
>     name=scan(_infile_,1,"=");
>     value=substr(_infile_,index(_infile_,"=")+1);
>     label name="Environment Variable Name"
>          value="Environment Variable Value"
>     ;
>   run;
>
>   filename _env2ds clear;
>   run;
>
>   x 'del C:\Windows\Temp\_env2dsw7.tmp';
>   run;
>
> %mend;
>
> %env2dsw7;

I have webbed two new macros %env2ds and %env2dsw7 to do this. The
second will work on Windows 7 or any Windows operating system for that
matter. I don't know why unnamed pipes do not work ion Windows 7 but
that's the way it is.

http://www.datasavantconsulting.com/roland/updates2.html

For an alphabetical list of all my Spectre macros then see here:

http://www.datasavantconsulting.com/roland/maclist2.html
From: Phil Holland on
In message
<881a3552-b6ed-4bf9-b309-6eb746dc26f2(a)t20g2000yqa.googlegroups.com>,
RolandRB <rolandberry(a)hotmail.com> writes
>On Aug 6, 10:39�am, RolandRB <rolandbe...(a)hotmail.com> wrote:
>> On Aug 3, 2:48�pm, Uelsasser <UlrichElsas...(a)t-online.de> wrote:
>>
>>
>>
>> > On 31 Jul., 10:57, RolandRB <rolandbe...(a)hotmail.com> wrote:
>>
>> > > On Jul 31, 10:37�am, francogrex <fra...(a)grex-removethis.com> wrote:
>>
>> > > > RolandRB wrote:
>> > > > >What happens when you run this sas code on Windows 7?
>> > > > >%macro env2ds(dsout);...<snip>
>>
>> > > > Yes it does work on windows xp (sas v9), it creates a set called
>> > > >_env2ds
>> > > > and as expected contains 2 columns of the env variable names
>> > > >and values;
>> > > > nice.
>>
>> > > Thanks. I know it works on Windows XP. It is whether it works on
>> > > Windows 7 either 32 bit or 64 bit I need to know.
>>
>> > Hi Roland
>>
>> > it does not work on WINDOWS 7 / 32 bit , SAS V9.2
>> > The log reads
>>
>> > NOTE: The infile _ENV2DS is:
>> > � � � Unnamed Pipe Access Device,
>> > � � � PROCESS=set,RECFM=V,LRECL=256
>>
>> > Stderr output:
>> > Das Handle ist ung ltig.
>> > Das Handle ist ung ltig.
>> > Das Handle ist ung ltig.
>> > Das Handle ist ung ltig.
>> > Das Handle ist ung ltig.
>> > ..........
>>
>> Hi Uli, this should work on Windows 7. It is annoying that unnamed
>> pipes do not work on Windows 7. This gets around it by writing to a
>> temporary file. I don't know of a simple method of working out if you
>> are on Windows 7 but if I did it would not be made part of the macro
>> below in any case.
>>
>> %macro env2dsw7(dsout);
>>
>> � %if not %length(&dsout) %then %let dsout=_env2ds;
>>
>> � x 'set > C:\Windows\Temp\_env2dsw7.tmp';
>>
>> � filename _env2ds 'C:\Windows\Temp\_env2dsw7.tmp';
>>
>> � data &dsout;
>> � � length name $ 40 value $ 1000;
>> � � infile _env2ds;
>> � � input;
>> � � name=scan(_infile_,1,"=");
>> � � value=substr(_infile_,index(_infile_,"=")+1);
>> � � label name="Environment Variable Name"
>> � � � � �value="Environment Variable Value"
>> � � ;
>> � run;
>>
>> � filename _env2ds clear;
>> � run;
>>
>> � x 'del C:\Windows\Temp\_env2dsw7.tmp';
>> � run;
>>
>> %mend;
>>
>> %env2dsw7;
>
>I have webbed two new macros %env2ds and %env2dsw7 to do this. The
>second will work on Windows 7 or any Windows operating system for that
>matter. I don't know why unnamed pipes do not work ion Windows 7 but
>that's the way it is.
>
>http://www.datasavantconsulting.com/roland/updates2.html
>
>For an alphabetical list of all my Spectre macros then see here:
>
>http://www.datasavantconsulting.com/roland/maclist2.html

Roland,

The Windows command "ver" returns the following line output on my
Windows 7 64-bit laptop:

Microsoft Windows [Version 6.1.7600]

The XP Mode returns:

Microsoft Windows XP [Version 5.1.2600]

You could try reading this output into a Data Step?

...........Phil
--
--------------------------------------------------------
Holland Numerics Ltd
94 Green Drift, Royston, Herts SG8 5BT, UK
mobile : +44-(0)7714-279085
email : <NEWS(a)hollandnumerics.com>
URL : http://www.hollandnumerics.com/
--------------------------------------------------------
From: RolandRB on
On 7 Aug., 22:36, Phil Holland <n...(a)hollandnumerics.com> wrote:
> In message
> <881a3552-b6ed-4bf9-b309-6eb746dc2...(a)t20g2000yqa.googlegroups.com>,
> RolandRB <rolandbe...(a)hotmail.com> writes
>
>
>
>
>
> >On Aug 6, 10:39 am, RolandRB <rolandbe...(a)hotmail.com> wrote:
> >> On Aug 3, 2:48 pm, Uelsasser <UlrichElsas...(a)t-online.de> wrote:
>
> >> > On 31 Jul., 10:57, RolandRB <rolandbe...(a)hotmail.com> wrote:
>
> >> > > On Jul 31, 10:37 am, francogrex <fra...(a)grex-removethis.com> wrote:
>
> >> > > > RolandRB wrote:
> >> > > > >What happens when you run this sas code on Windows 7?
> >> > > > >%macro env2ds(dsout);...<snip>
>
> >> > > > Yes it does work on windows xp (sas v9), it creates a set called
> >> > > >_env2ds
> >> > > > and as expected contains 2 columns of the env variable names
> >> > > >and values;
> >> > > > nice.
>
> >> > > Thanks. I know it works on Windows XP. It is whether it works on
> >> > > Windows 7 either 32 bit or 64 bit I need to know.
>
> >> > Hi Roland
>
> >> > it does not work on WINDOWS 7 / 32 bit , SAS V9.2
> >> > The log reads
>
> >> > NOTE: The infile _ENV2DS is:
> >> >       Unnamed Pipe Access Device,
> >> >       PROCESS=set,RECFM=V,LRECL=256
>
> >> > Stderr output:
> >> > Das Handle ist ung ltig.
> >> > Das Handle ist ung ltig.
> >> > Das Handle ist ung ltig.
> >> > Das Handle ist ung ltig.
> >> > Das Handle ist ung ltig.
> >> > ..........
>
> >> Hi Uli, this should work on Windows 7. It is annoying that unnamed
> >> pipes do not work on Windows 7. This gets around it by writing to a
> >> temporary file. I don't know of a simple method of working out if you
> >> are on Windows 7 but if I did it would not be made part of the macro
> >> below in any case.
>
> >> %macro env2dsw7(dsout);
>
> >>   %if not %length(&dsout) %then %let dsout=_env2ds;
>
> >>   x 'set > C:\Windows\Temp\_env2dsw7.tmp';
>
> >>   filename _env2ds 'C:\Windows\Temp\_env2dsw7.tmp';
>
> >>   data &dsout;
> >>     length name $ 40 value $ 1000;
> >>     infile _env2ds;
> >>     input;
> >>     name=scan(_infile_,1,"=");
> >>     value=substr(_infile_,index(_infile_,"=")+1);
> >>     label name="Environment Variable Name"
> >>          value="Environment Variable Value"
> >>     ;
> >>   run;
>
> >>   filename _env2ds clear;
> >>   run;
>
> >>   x 'del C:\Windows\Temp\_env2dsw7.tmp';
> >>   run;
>
> >> %mend;
>
> >> %env2dsw7;
>
> >I have webbed two new macros %env2ds and %env2dsw7 to do this. The
> >second will work on Windows 7 or any Windows operating system for that
> >matter. I don't know why unnamed pipes do not work ion Windows 7 but
> >that's the way it is.
>
> >http://www.datasavantconsulting.com/roland/updates2.html
>
> >For an alphabetical list of all my Spectre macros then see here:
>
> >http://www.datasavantconsulting.com/roland/maclist2.html
>
> Roland,
>
> The Windows command "ver" returns the following line output on my
> Windows 7 64-bit laptop:
>
> Microsoft Windows [Version 6.1.7600]
>
> The XP Mode returns:
>
> Microsoft Windows XP [Version 5.1.2600]
>
> You could try reading this output into a Data Step?
>
> ..........Phil
> --
> --------------------------------------------------------
> Holland Numerics Ltd
>         94 Green Drift, Royston, Herts SG8 5BT, UK
>         mobile : +44-(0)7714-279085
>         email  : <N...(a)hollandnumerics.com>
>         URL    :http://www.hollandnumerics.com/
> --------------------------------------------------------- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -

I might write a separate macro to do this but I would not want to make
it part of the existing %env2ds macro. I don't know what using "ver"
would return on other Windows operating systems so I am reluctant to
use it.
From: data _null_; on
On Aug 9, 4:14 am, RolandRB <rolandbe...(a)hotmail.com> wrote:
> On 7 Aug., 22:36, Phil Holland <n...(a)hollandnumerics.com> wrote:
>
>
>
>
>
> > In message
> > <881a3552-b6ed-4bf9-b309-6eb746dc2...(a)t20g2000yqa.googlegroups.com>,
> > RolandRB <rolandbe...(a)hotmail.com> writes
>
> > >On Aug 6, 10:39 am, RolandRB <rolandbe...(a)hotmail.com> wrote:
> > >> On Aug 3, 2:48 pm, Uelsasser <UlrichElsas...(a)t-online.de> wrote:
>
> > >> > On 31 Jul., 10:57, RolandRB <rolandbe...(a)hotmail.com> wrote:
>
> > >> > > On Jul 31, 10:37 am, francogrex <fra...(a)grex-removethis.com> wrote:
>
> > >> > > > RolandRB wrote:
> > >> > > > >What happens when you run this sas code on Windows 7?
> > >> > > > >%macro env2ds(dsout);...<snip>
>
> > >> > > > Yes it does work on windows xp (sas v9), it creates a set called
> > >> > > >_env2ds
> > >> > > > and as expected contains 2 columns of the env variable names
> > >> > > >and values;
> > >> > > > nice.
>
> > >> > > Thanks. I know it works on Windows XP. It is whether it works on
> > >> > > Windows 7 either 32 bit or 64 bit I need to know.
>
> > >> > Hi Roland
>
> > >> > it does not work on WINDOWS 7 / 32 bit , SAS V9.2
> > >> > The log reads
>
> > >> > NOTE: The infile _ENV2DS is:
> > >> >       Unnamed Pipe Access Device,
> > >> >       PROCESS=set,RECFM=V,LRECL=256
>
> > >> > Stderr output:
> > >> > Das Handle ist ung ltig.
> > >> > Das Handle ist ung ltig.
> > >> > Das Handle ist ung ltig.
> > >> > Das Handle ist ung ltig.
> > >> > Das Handle ist ung ltig.
> > >> > ..........
>
> > >> Hi Uli, this should work on Windows 7. It is annoying that unnamed
> > >> pipes do not work on Windows 7. This gets around it by writing to a
> > >> temporary file. I don't know of a simple method of working out if you
> > >> are on Windows 7 but if I did it would not be made part of the macro
> > >> below in any case.
>
> > >> %macro env2dsw7(dsout);
>
> > >>   %if not %length(&dsout) %then %let dsout=_env2ds;
>
> > >>   x 'set > C:\Windows\Temp\_env2dsw7.tmp';
>
> > >>   filename _env2ds 'C:\Windows\Temp\_env2dsw7.tmp';
>
> > >>   data &dsout;
> > >>     length name $ 40 value $ 1000;
> > >>     infile _env2ds;
> > >>     input;
> > >>     name=scan(_infile_,1,"=");
> > >>     value=substr(_infile_,index(_infile_,"=")+1);
> > >>     label name="Environment Variable Name"
> > >>          value="Environment Variable Value"
> > >>     ;
> > >>   run;
>
> > >>   filename _env2ds clear;
> > >>   run;
>
> > >>   x 'del C:\Windows\Temp\_env2dsw7.tmp';
> > >>   run;
>
> > >> %mend;
>
> > >> %env2dsw7;
>
> > >I have webbed two new macros %env2ds and %env2dsw7 to do this. The
> > >second will work on Windows 7 or any Windows operating system for that
> > >matter. I don't know why unnamed pipes do not work ion Windows 7 but
> > >that's the way it is.
>
> > >http://www.datasavantconsulting.com/roland/updates2.html
>
> > >For an alphabetical list of all my Spectre macros then see here:
>
> > >http://www.datasavantconsulting.com/roland/maclist2.html
>
> > Roland,
>
> > The Windows command "ver" returns the following line output on my
> > Windows 7 64-bit laptop:
>
> > Microsoft Windows [Version 6.1.7600]
>
> > The XP Mode returns:
>
> > Microsoft Windows XP [Version 5.1.2600]
>
> > You could try reading this output into a Data Step?
>
> > ..........Phil
> > --
> > --------------------------------------------------------
> > Holland Numerics Ltd
> >         94 Green Drift, Royston, Herts SG8 5BT, UK
> >         mobile : +44-(0)7714-279085
> >         email  : <N...(a)hollandnumerics.com>
> >         URL    :http://www.hollandnumerics.com/
> > --------------------------------------------------------- Zitierten Text ausblenden -
>
> > - Zitierten Text anzeigen -
>
> I might write a separate macro to do this but I would not want to make
> it part of the existing %env2ds macro. I don't know what using "ver"
> would return on other Windows operating systems so I am reluctant to
> use it.- Hide quoted text -
>
> - Show quoted text -

As you know SAS-L and this Google group are no longer connected.

There is a similar, I think, thread on SAS-L this morning. It
references this SAS-L thread from 25FEB2010. I don't know if it will
work or not, I cannot test it.

http://www.listserv.uga.edu/cgi-bin/wa?A2=ind1002D&L=sas-l&D=0&H=0&O=T&T=1&P=32344