Hi People In few words, I'm trying to export a table composed by characters column to a unique text file with no headers and with each column assigned to a specific position in the text file, which has a ficed lenght the code is below. the first part of the code create the table, the second one is supposed to export the table to the text file the issue is related to the first four columns. for some reason I get the following in the log: NOTE: Variable 'Type_of_file 'n is uninitialized. NOTE: Variable ' Bank_no 'n is uninitialized. NOTE: Variable ' Branch_no 'n is uninitialized. NOTE: Variable ' Product'n is uninitialized. NOTE: The file '/intl/iccs_emea/dcortell/facturacion2.txt' is: Filename=/intl/iccs_emea/dcortell/facturacion2.txt, Owner Name=dcortell,Group Name=bis, Access Permission=-rw-r--r--, Last Modified=27Oct2016:08:10:16 NOTE: 14314 records were written to the file '/intl/iccs_emea/dcortell/facturacion2.txt'. The minimum record length was 147. The maximum record length was 147. NOTE: There were 14314 observations read from the data set WORK.FACTURACIONTEXT. NOTE: DATA statement used (Total process time): real time 0.07 seconds cpu time 0.03 seconds So that the first four columns are not initialized and so the corresponding spaces in the txt files are not populated. The weird thing is that this happen also for others tables which I have tried to export in the same way to a text file. The export goes fine for all the others columns except as said for the first four. really no idea about what could cause this issue as a. the source table is created correctly b. other colleagues of mine have run the same code without any problem regarding the first four colums Any hints or help are welcomed Bests Davide %_eg_conditional_dropds(WORK.facturaciontext);
proc sql;
create table facturaciontext as
select
Type_of_file length=2 format=$2. informat=$char2. as Type_of_file,
Bank_no length=4 format=$4. informat=$char4. as Bank_no,
Branch_no length=4 format=$4. informat=$char4. as Branch_no,
Product length=3 format=$3. informat=$char3. as Product ,
Num_Contrato,
('00'||put(Sub_Tipo_Producto, z1.)) length=3 format=$3. informat=$char3. as Sub_tipo_Producto ,
Referencia_TRC,
currency length=3 format=$3. informat=$char3. as currency,
(put(year(Fecha_Alta),z4.) || put(month(Fecha_Alta),z2.) || put(day(Fecha_Alta), z2.)) length=8 format=$8. informat=$char8. as Fecha_Alta,
Monthly_spend length=15 format=$15. informat=$char15. as Monthly_spend ,
('+'||case when Average_spend is missing then "000000000000" else substr(put(Average_spend, z15.2),1,12) end||case when Average_spend is missing then "00" else
substr(put(Average_spend, z15.2),14,2)end) length=15 format=$15. informat=$char15. as Average_spend ,
('+'||case when Last_year_annual_spend is missing then "000000000000" else substr(put(Last_year_annual_spend, z15.2),1,12)end||case when Last_year_annual_spend is missing then "00" else
substr(put(Last_year_annual_spend, z15.2),14,2) end) length=15 format=$15. informat=$char15. as Last_year_annual_spend,
('+'||case when Acumulated_annual_spend is missing then "000000000000" else substr(put(Acumulated_annual_spend, z15.2),1,12) end||case when Acumulated_annual_spend is missing then "00" else
substr(put(Acumulated_annual_spend, z15.2),14,2) end) length=15 format=$15. informat=$char15. as Acumulated_annual_spend ,
('+'||case when Faturacion_Acumulada_Mes is missing then "000000000000" else substr(put(Faturacion_Acumulada_Mes, z15.2),1,12) end||
case when Faturacion_Acumulada_Mes is missing then "00" else substr(put(Faturacion_Acumulada_Mes, z15.2),14,2) end) length=15 format=$15. informat=$char15. as Faturacion_Acumulada_Mes,
Periodicty length=1 format=$1. informat=$char1. as Periodicity,
Fill_in,
Billing_date length=8 format=$8. informat=$char8. as Billing_date,
End_of_file
from work.facturacion t1;
quit;
data _null_ ;
set work.facturaciontext ;
file '/intl/iccs_emea/dcortell/facturacion2.txt' lrecl=148;
put @1 Type_of_file +(-1) @3 Bank_no +(-1) @7 Branch_no +(-1) @11 Product +(-1) @14 Num_contrato +(-1) @21 Sub_Tipo_Producto +(-1) @24 Referencia_TRC
+(-1) @44 currency +(-1) @47 Fecha_Alta +(-1) @55 Monthly_spend +(-1) @70 Average_spend +(-1) @85 Last_year_annual_spend +(-1) @100 Acumulated_annual_spend +(-1)
+(-1) @115 Faturacion_Acumulada_Mes +(-1) @130 Periodicity +(-1) @131 Fill_in +(-1) @139 Billing_date +(-1) @147 End_of_file +(-1) ;
run;
... View more