Help using Base SAS procedures

Proc export unable to read all columns

Reply
Frequent Contributor
Posts: 85

Proc export unable to read all columns

I am using proc export .txt files with delimiter '|'

while importing this .txt files i am getting missing  values for some  columns

i am unable to get allvalues almost i am exporting 40 columns and importing them

PROC Star
Posts: 7,364

Proc export unable to read all columns

You will have to show some example data and the code you are using to export and import.

Frequent Contributor
Posts: 85

Proc export unable to read all columns

This is sample code iam using

proc export data=sample;
outfile="path/sample.txt"
dbms=dlm replace;
delimiter='|';
run;


data sample;
infile "path/sample.txt" firstobs=2
dlm='|' dsd missover;
attrib ACODE length=$7. informat=$7. format=$7.;
attrib X_PRD informat=anydtdte32. format=MMDDYY10.;
attrib I_NO length=$10. informat=$10. format=$10.;
attrib EI_SYS length=$3. informat=$3. format=$3.;
attrib S_PORTCODE length=$10. informat=$10. format=$10.;
attrib S_BILLNO length=$10. informat=$10. format=$10.;
attrib EXP_DT informat=anydtdte32. format=MMDDYY10.;
attrib DUE_DT informat=anydtdte32. format=MMDDYY10.;
attrib EXTN_GR length=$1. informat=$1. format=$1.;
attrib EXTN_AUTHO length=$4. informat=$4. format=$4.;
attrib EXTN_DT informat=anydtdte32. format=MMDDYY10.;
attrib ADCODE length=$7. informat=$7. format=$7.;
attrib REALISE length=$1. informat=$1. format=$1.;
attrib REALISE_DT informat=anydtdte32. format=MMDDYY10.;
attrib REMARK length=$35. informat=$35. format=$35.;


input  ACODE X_PRD I_NO EI_SYS BILL_NO BILL_DT
STATUS_H EXP_NAME EXP_ADDR1 EXP_ADDR2 EXP_CITY EXP_PIN S_PORT
S_PORTCODE S_BILLNO EXP_DT   DUE_DT EXTN_GR
EXTN_AUTHO EXTN_DT EXP_CTRY EXP_COMM INV_CUR INV_AMT INV_INR
R_CURR R_AMT OS_AMT OSB_NAME OSB_ADDR1 OSB_ADDR2 OSB_CTRY
OSB_PIN REALISE REALISE_DT REMARK ;
run;

I am declearing all column attribs which mentioned in input statement

in output i am getting missing date columns and some numeric columns

PROC Star
Posts: 7,364

Proc export unable to read all columns

What do your dates actually look like?  I can't imagine a date that would take up 32 columns.  Are you possibly trying to read in datetime fields?

Frequent Contributor
Posts: 85

Proc export unable to read all columns

Date format is 31DEC2011:00:00:00

and by applying attribs i am converting into MMDDYY10.

PROC Star
Posts: 7,364

Proc export unable to read all columns

I just noticed that your post never received an answer.  Your dates aren't dates, they are datetimes.

Try replacing the anydtdte32. with andtdtm32. and see if that corrects the problem.

Super User
Posts: 10,543

Proc export unable to read all columns

You might want to add a LRECL= 32767 parameter on your INFILE statement (probably doesn't have to be as big as 32767 but that provides room for lots of difference in columns). The lengths of the variables with attributes listed totals to 248 columns and the added numerics are likely pushing it over the default 256 columns.

Ask a Question
Discussion stats
  • 6 replies
  • 199 views
  • 0 likes
  • 3 in conversation