BookmarkSubscribeRSS Feed
R_Win
Calcite | Level 5
Hi can any one help me by giving correct defonotion for missover and truncover with examples.
4 REPLIES 4
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
The SAS support website http://support.sas.com/ has a wealth of information and DOC for what you're asking. A search at the site using your keywords generates several hits. Also, a Google advanced search using the keywords below also provides many hits:

+missover +truncover site:sas.com

Also, you can add the following PUTLOG (new with SAS 9) statement to generate additional diagnostics with your DATA step to see how SAS handles the various conditions.

Scott Barry
SBBWorks, Inc.

SAS 9.2 DOC on INFILE statement:
http://support.sas.com/documentation/cdl/en/lrdict/59540/HTML/default/a000146932.htm

SAS support DOC starting page (recommend bookmarking this page):
http://support.sas.com/documentation/
deleted_user
Not applicable
Hi All,
I have a Ascii file which is fixed width length. In the SAS program, I am reading the file through Infile option. I have data as below:

1201 2008-10-31 5702345678 2334
First column I should read as : 1
Second Column: 201
Third Column:
Fourth: 2008-10-31
Fifth:
Sixth:
Seventh:
Eigth:570
Ninth:2345678
tenth:
Eleventh:2334

But when I use infile option it is only reading first three columns and rest columns are empty even though some of the columns are having data.

Here is my code snippet.
data _null_;
filename temp "/mydir/filename.txt";
libname wip '$PWD/old';

data wip.basic_xtrct;
infile temp truncover;
input @1 first $1.
@2 Second $3.
@3 Third $10.
run;

Can you please help me in solving this issue.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Your INPUT statement is using the "@" pointer incorrectly, providing an offset location (column pointer position) within your data record.

Scott Barry
SBBWorks, Inc.

SAS Language Dictionary: INPUT Statement discussion (with ref to "column pointer" usage)
http://support.sas.com/documentation/cdl/en/lrdict/59540/HTML/default/a000146292.htm
Cynthia_sas
SAS Super FREQ
Hi:
As Scott suggested, the doc on column pointer control may prove useful. In addition, it helps to see the data in a "fixed pitch font", where the letter 'i' takes up the same amount of physical space on the line as the letter 'w':
[pre]
0 0 1 1 2 2 3
1...5....0....5....0....5....0...
1201 2008-10-31 5702345678 2334
abbbc2008-10-31defggghhhhhhhijjjj
xyyyz2008-10-30klmnnnooooooopqqqq
[/pre]

In the above example, I've taken your data and made it appear in a fixed font. I've added some "column info" above your data. So, you can see that position 1 (or @1) in the input line holds the value '1'. The date 2008-10-31 starts in position 6 (or @6) -- it may only be the 4th variable you read, but it starts in position 6 on the input line (each . represents a column position -- I've only shown the starting 1 and 5 in the column info).

Similarly, your value '570' starts in position 19 or @19 and your value '2334' starts in position 30 or @30.... so working with this "fixed pitch" view of your data, may help you figure out the correct INPUT statement. In order to use column pointer control effectively, ALL your data lines must line up the same way, in the same columns, when you look at them in NOTEPAD. (I made a couple of extra dummy datalines, so you could see everything "line up".)

cynthia

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register 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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1009 views
  • 0 likes
  • 4 in conversation