Date: Wed, 17 Dec 2008 12:21:09 +0100
Reply-To: Andre Wielki <wielki@INED.FR>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Andre Wielki <wielki@INED.FR>
Subject: Re: Cards
In-Reply-To: <187d74b7-a2f0-44e0-8038-4e8ba02c53ed@n33g2000pri.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Ceci marche bien
mais il faut lire la log
when reading the log message you encounter
with
data ref_produit;
INPUT CODE $2. LIBELLE $100.;
CARDS;
NOTE: SAS went to a new line when INPUT statement reached past the end
of a line.
NOTE: The data set WORK.REF_PRODUIT has 6 observations and 2 variables.
Sas is going over a shorter record than 100 positions so you have only 6
obseervations
and not 12!
reading with
data ref_produit;
infile cards missover ;*lrecl=103 pad;
INPUT CODE $2. LIBELLE $100.;
CARDS;
is not solving it as the second variable is empty
even if you got 12 observtions
NB: extending virtual length of record is not possible with inline cards
data!
If i put your jamesbond data in ash007.txt
the problem is solved
filename jbond "d:\ash007.txt";
data extern_produit;
infile jbond lrecl=103 pad;
INPUT CODE $2. LIBELLE $100.;
run;
BUT with cards
if you are using a format modifier &
which is accepting accept ONE blanks to explore a list free format
the problem is also solved
data ref_produit;
length libelle $ 100;
INPUT CODE $2. LIBELLE &;
CARDS;
AA Capital Décès/PTIA CNP Conjoint 9536Q
AB Capital Décès/PTIA CNP MP 9536Q
AC Garanties Prévoyance
AD Garanties Santés
AE Garantie Accueil
AF Allocation Frais d'obsèques
AG Garantie Bien-être
AH Garantie Confort
AI Capital Décès PTIA CNP MP
AJ Capital Décès IPA Statutaire
AK Capital Décès IPA Statutaire (a)
AL Capital Décès PTIA CNP MP (a)
;
run;
Now libelle could be shortered.
HTH
Andre
ash007 a écrit :
> Hello,
>
> Why my programm doesn't work ?
>
> Thanks.
>
> Ash007.
>
> data ref_produit;
> INPUT CODE $2. LIBELLE $100.; CARDS;
> AA Capital Décès/PTIA CNP Conjoint 9536Q
> AB Capital Décès/PTIA CNP MP 9536Q
> AC Garanties Prévoyance
> AD Garanties Santés
> AE Garantie Accueil
> AF Allocation Frais d'obsèques
> AG Garantie Bien-être
> AH Garantie Confort
> AI Capital Décès PTIA CNP MP
> AJ Capital Décès IPA Statutaire
> AK Capital Décès IPA Statutaire (a)
> AL Capital Décès PTIA CNP MP (a)
>
>
--
André WIELKI
INED (Institut National d'Etudes Démographiques)
Service Informatique
133 Boulevard Davout 75980 Paris Cedex 20
mél : wielki@ined.fr tél : 33 (0) 1 56 06 21 54