From 9b32e6e3f27f7c620d415c8d9338a790c1d759dc Mon Sep 17 00:00:00 2001 From: Allan Bowe Date: Mon, 27 Sep 2021 20:12:48 +0100 Subject: [PATCH 1/2] fix: removing nonprintables from cards data. Closes #80 --- all.sas | 7 ++++++- base/mp_ds2cards.sas | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/all.sas b/all.sas index d382c14..837cd95 100644 --- a/all.sas +++ b/all.sas @@ -3474,7 +3474,12 @@ data datalines_2; */ else if upcase(format)=:'$HEX' then dataline=cats('put(trim(',name,'),',format,')'); - else dataline=name; + /** + * There is no easy way to store line breaks in a cards file. + * To discuss this, use: https://github.com/sasjs/core/issues/80 + * Removing all nonprintables with kw (keep writeable) + */ + else dataline=cats('compress(',name,', ,"kw")'); run; proc sql noprint; diff --git a/base/mp_ds2cards.sas b/base/mp_ds2cards.sas index cdfe72f..e50d2b5 100644 --- a/base/mp_ds2cards.sas +++ b/base/mp_ds2cards.sas @@ -161,7 +161,12 @@ data datalines_2; */ else if upcase(format)=:'$HEX' then dataline=cats('put(trim(',name,'),',format,')'); - else dataline=name; + /** + * There is no easy way to store line breaks in a cards file. + * To discuss this, use: https://github.com/sasjs/core/issues/80 + * Removing all nonprintables with kw (keep writeable) + */ + else dataline=cats('compress(',name,', ,"kw")'); run; proc sql noprint; From 4887f355c8699bbfa2e8cc30b3fb175e44ec229b Mon Sep 17 00:00:00 2001 From: Allan Bowe Date: Mon, 27 Sep 2021 20:14:52 +0100 Subject: [PATCH 2/2] fix: removing redundant dlm option --- all.sas | 2 +- base/mp_ds2cards.sas | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/all.sas b/all.sas index 837cd95..a11ca94 100644 --- a/all.sas +++ b/all.sas @@ -3556,7 +3556,7 @@ data _null_; put 'run;'; end; else do; - put "infile cards dsd delimiter=',';"; + put "infile cards dsd;"; put "input "; %do i = 1 %to &nvars.; %if(%length(&&input_stmt_&i..)) %then diff --git a/base/mp_ds2cards.sas b/base/mp_ds2cards.sas index e50d2b5..379620c 100644 --- a/base/mp_ds2cards.sas +++ b/base/mp_ds2cards.sas @@ -243,7 +243,7 @@ data _null_; put 'run;'; end; else do; - put "infile cards dsd delimiter=',';"; + put "infile cards dsd;"; put "input "; %do i = 1 %to &nvars.; %if(%length(&&input_stmt_&i..)) %then