Hi to all!!!
I have to read one file with only one SINGLE record and put it in SAS table with more records. the file is with this one record:
19941231 C 19950216 19950216 16000000 18300000 19951231 C T 19960226 19960226 17060000 20150000 19961130 19961207 19961207 10000000 18000000 ...... .................. ..................................... ......................
obviously the record is more long.
In general I make infile with multiple record and I hadn't any problems but I have some problems to create a sas program which reads only this record.
have you some idea?
I reckon LRECL=N is what you need. Notice I remove @@;
Can you please define your multiple records in a meaningful way to prepare the SAS Codes from it...
In your post, what all those number represants ??? if you simply want to read one line which contains many variables then use double trailing @@ in your INPUT statement like this...
Input variable_name @@;
-Urvish
hi,
I can't define the files which I have to read.....
the layout is this:
data-elaboration 8 (aaaammgg)
filler1 $1
ch $1
filler2 $1
sw $1
filler3 $1
data-initialization 8 (aaaammgg)
filler4 $1
data-fin 8 (aaaammgg)
filler5 $1
hour-ini 8
filler5 $1
hour-fin 8
filler7 $32
the filler are always missing(' '), and ch or sw can be missing(' ') or one single charachter.
and the files contains only one record:
19941231 C 19950216 19950216 16000000 18300000 19951231 C T 19960226 19960226 17060000 20150000 19961130 19961207 19961207 10000000 18000000 19961231 19970105 19970105 10000000 18000000............................................................... ....................................
if you have some idea I'm gratefull...
thanks...
This looks about right.
Hi,
can you try with the file which I have attached in this response...
because, my programm don't finish..
I reckon LRECL=N is what you need. Notice I remove @@;
THANKS!!!!!!!
Try following code...
data want;
input data_elaboration 8.
filler1 $1.
ch $1.
filler2 $1.
sw $1.
filler3 $1.
data_initialization 8.
filler4 $1.
data_fin 8
filler5 $1.
hour_ini 8.
filler6 $1.
hour_fin 8.
filler7 $1. @@;
cards4;
12345678 C T 12358789 12547898 20145789 4578912
;;;;
Hope it helps...
-Urvish
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.