View previous topic :: View next topic
|
Author |
Message |
shamsundar_mk
New User
Joined: 18 May 2007 Posts: 30 Location: CHENNAI
|
|
|
|
I have coded a SAS pgm as follows:
DATA WORK;
INFILE IN;
FILE OUT1;
INPUT @1 INF $CHAR76.;
PUT @1 INF $CHAR76.;
RUN;
the i/p file has following data:
(col 1-80)
AAA this is test...............................................................
AAA this is not test............................................................
CCC
BBB this is test...............................................................
BBB this is not test............................................................
The third row in input file has data only from col 1-3.
the o/p given by the sas pgm is as follows which is incorrect:
AAA this is test...............................................................
AAA this is not test............................................................
BBB this is test...............................................................
BBB this is not test............................................................
In the o/p file, the third row is not getting displayed.
Could you please help me. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
Works for me - please post your SASlog as code.
Code: |
DATA WORK;
INFILE IN;
FILE OUT1;
INPUT @1 INF $CHAR76.;
PUT @1 INF $CHAR76.;
RUN; |
Code: |
AAA THIS IS TEST..........................
AAA THIS IS NOT TEST......................
CCC
BBB THIS IS TEST..........................
BBB THIS IS NOT TEST |
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Works fine on my system ................... cut & pasted your code and got
Code: |
AAA TEST
AAA NO TEST
CCC
BBB TEST
BBB NOTEST
|
|
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
maybe he just can't C it (sorry it's just my warped sense of humour).
Gerry |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
gcicchet wrote: |
Hi,
maybe he just can't C it (sorry it's just my warped sense of humour).
Gerry |
Well, it brought a smile to my face |
|
Back to top |
|
|
Alan Voss
New User
Joined: 29 Nov 2006 Posts: 32 Location: Jacksonville, FL
|
|
|
|
If you are reading a variable blocked record, you will not, by default get the third line because the record is not 76 bytes long. Change your infile statement to:
Code: |
INFILE IN truncover;
|
and I am pretty certain that your problem will go away (default, I believe) is SKIPOVER. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
If only the OP had mentioned the possibility of a VB file
Good spot Alan |
|
Back to top |
|
|
|