[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sas-l
Subject:    Re: SCL list to sas dataset
From:       Anthony Ayiomamitis <ayiomamitis () IBM ! NET>
Date:       1997-08-30 23:01:49
[Download RAW message or body]

Gentlemen,

    The "conversion" of an SCL list into a SAS dataset is quite doable.
For example, consider the SCL list with id HARMID and contents (1, 2, 3,
4, 5). Now, to create a work dataset named HARM with a field named ITEM,
one could use the following SCL code (not tested):

    if exist ('work.harm') then
       rc = delete ('work.harm');
    dsid = open ('work.harm', 'n');
    rc = newvar (dsid, 'item', n, 8, 'Item #');
    rc = close (dsid);

    dsid = open ('work.harm', 'u');
    maxobs = listlen (harmid);
    do i=1 to maxobs;
       value = getitemn (harmid, i);
       rc = append (dsid);
       call putvarn (dsid, varnum(dsid, 'item'), value);
       rc = update (dsid);
    end;
    rc = close (dsid);

Anthony.

Harm Schipper wrote:
>
> Scott,
>
> As far as I know, there is not a way to do it directly. However, you
> could save the list in an external file (by using the savelist
> function) and then read this file using an infile statement into a
> data step.
>
> Good luck!
>
> Harm Schipper
> SAS Consultant
> E-mail: HarmSchipper@compuserve.com
>
> On Fri, 22 Aug 1997 09:31:21 -0700, Scott Carl <SCARL@THECREEK.COM>
> wrote:
>
> >Hi,
> >
> >I am looking for the "best" way to create a sas dataset from an SCL
> >list. Any thoughts?
> >
> >

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic