BookmarkSubscribeRSS Feed
KevinC_
Fluorite | Level 6
Hello all,

I have a delimited input file with close to 100 fields. i would like to append data to the end of each row. But i don't want to define each of the 100 fields in the input section. in addition, since it's a delimited file, each row has different length. Is there a way to skip to the end of each row from an input file when reading it?

Thanks for any input!
kevin
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Using a DATA step, it is possible to read up the current data record using an INFILE and INPUT statement, and then address it with the SAS reserved variable _INFILE_ for whatever purpose you might require. A very simple SAS DATA step is listed below for your review/consideration.

Also, the INFILE statement has parameters you can code to identify the record length, current column pointer location -- review the SAS Language INFILE discussion for details.

Scott Barry
SBBWorks, Inc.

data _null_;
infile datalines dsd truncover dlm=',';
input @;
putlog _all_ / _infile_;
cards;
a,b,c,d
e,f,g,h
run;
ChrisNZ
Tourmaline | Level 20
Or you could skip n fields by reading past them:
[pre]
input var1-varn $ @;
drop var:;

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore Now →
What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1369 views
  • 0 likes
  • 3 in conversation