BookmarkSubscribeRSS Feed
vivekarun12
Calcite | Level 5

Hi,

 

I have column “Description” which contains huge characters, while am fetching the data, it shows incomplete character of this columns. How can I get all the characters.

 

Columns contains some of the special characters like “x(xx) % ===========================”

 

Pls help me. Thanks in advance.

7 REPLIES 7
Kurt_Bremser
Super User

I take it you meant "many", not "huge". "Huge" lets me think of something big made by an artisan, probably out of marble 😉

 

When using proc import, make sure that the guessingrows= value is sufficient so that proc import finds the longest value.

 

Otherwise (manually written data step), adapt the informat to accomodate the longest value, as specified by the file documentation.

Shmuel
Garnet | Level 18

Did you use proc import to transfer data in sas dataset ? What do you mean by "fetch"?

 

If you used a datastep to read flat file (like .txt, .csv, datalines) then add a length statement to define maximum length available.

vivekarun12
Calcite | Level 5

Thanks for your reply. Am a beginner to SAS program.Am using proc sql to extract a data then using "Sent To Excel" option

Proc sql;

select description

from 

inc.inc_mast;

run;

 

Expected result - "FAILED. ================================================================= Hostname"

Result am getting - "FAILED. ================================================================="

 

How to over come this.. pls help me.

 

 

ballardw
Super User

@vivekarun12 wrote:

Thanks for your reply. Am a beginner to SAS program.Am using proc sql to extract a data then using "Sent To Excel" option

Proc sql;

select description

from 

inc.inc_mast;

run;

 

Expected result - "FAILED. ================================================================= Hostname"

Result am getting - "FAILED. ================================================================="

 

How to over come this.. pls help me.

 

 


Ar you sure that value is actually "FAILED. ================================================================= Hostname" in the data set inc.inc_mast?

 

If so are you looking at the result in Excel and have you tried making the column wider in Excel? Excel may be wrapping the text because the column is not wide enough.

vivekarun12
Calcite | Level 5

Apologies for the late reply.. Yes am sure.. i have checked the excel cell itself.. it showing incomplete data for "Description" column.

 

Pls help me on this..

Kurt_Bremser
Super User

Use the macro provided in https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... to convert your dataset inc.inc_mast into a data step and post that here (use firstobs= and obs= to create a subset with the relevant lines, if the dataset is large)

I just created a dataset with

data test;
x1 = "FAILED. ================================================================= Hostname";
run;

and used "Send to Excel" from Enterprise Guide, and got correct data in Excel.

Windows 7 Professional SP1

Enterprise Guide 7.1

Excel 14 (MS Office Standard 2010)

SAS 9.2 on AIX

 

Kurt_Bremser
Super User

@vivekarun12 wrote:

Thanks for your reply. Am a beginner to SAS program.Am using proc sql to extract a data then using "Sent To Excel" option

Proc sql;

select description

from 

inc.inc_mast;

run;

 

Expected result - "FAILED. ================================================================= Hostname"

Result am getting - "FAILED. ================================================================="

 

How to over come this.. pls help me.

 

 


BTW "Send To" is a very inefficient way to communicate with Excel. The best way to get data from one application to another (IMO) is to use files in an open, textual format like csv. Our whole "from" and "to" communication with the data warehouse happens in this way.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 678 views
  • 0 likes
  • 4 in conversation