tags:

views:

645

answers:

2

I am running SAS version 8.1 on the OpenVMS 8.3 platform. I have tried 2 different ways to import a csv data file and cant seem to get either of them to work properly. It would be great if anyone has any ideas as to what I may be doing wrong. This seems like a rather simple thing to do.

CSV file

SSID,field1,......(etc)

AA9999999,043844,.......(etc)

Method A -- This seems to "almost" work.

DATA JU2_DAT;

   INFILE STD_JU2  DSD LRECL=1024 TRUNCOVER FIRSTOBS=2;

   INPUT    ID $
            field1 $

For some reason the last character of the ID field is cut off...instead of getting 9 characters I am getting only 8.

Method B

PROC IMPORT DATAFILE=STD_JU2 OUT=JU2_DAT DBMS=CSV ; GETNAMES=YES;

This method just doesn't seem to run at all. It pegs the CPU at 100% and when I terminate the process I have the following errors in the LOG. This one baffles me as I am not running this in any kind of windowing environment.

ERROR: Cannot open X display. Check display name/server access authorization.

+ERROR: Cannot open X display. Check display name/server access authorization.

+ERROR: Cannot open X display. Check display name/server access authorization.

+

+

ERROR: Device does not support full-screen.

+ERROR: Device does not support full-screen.

+ERROR: Device does not support full-screen.

ERROR: Named item not found in list.

+ERROR: Named item not found in list.

+ERROR: Named item not found in list.

+5  A: 

I would try adding an informat to your input statement. The default length is 8 chars. Use the colon modifier which will cause SAS to read for :$X. chars OR until a delimiter is encountered.

INFILE STD_JU2  DSD LRECL=1024 TRUNCOVER FIRSTOBS=2;
INPUT    ID :$9.
        field1 $
CarolinaJay65
Thanks...I will give that a try.
Dan Adams
That worked perfectly...THANKS!!!
Dan Adams
A: 

I have never used OpenVMS, but I have seen the error message:

ERROR: Cannot open X display. Check display name/server access authorization.

or something similar under Unix when running without an X server. The solution was to invoke SAS with the -nodms (or possibly -nodmr) command line option.

Simon Nickerson