Incomplete Character while Fetching

Reply
Occasional Contributor
Posts: 13

Incomplete Character while Fetching

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.

Super User
Posts: 6,938

Re: Incomplete Character while Fetching

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

 

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Trusted Advisor
Posts: 1,378

Re: Incomplete Character while Fetching

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.

Occasional Contributor
Posts: 13

Re: Incomplete Character while Fetching

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.

 

 

Super User
Posts: 10,500

Re: Incomplete Character while Fetching


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.

Occasional Contributor
Posts: 13

Re: Incomplete Character while Fetching

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..

Super User
Posts: 6,938

Re: Incomplete Character while Fetching

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

 

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 6,938

Re: Incomplete Character while Fetching


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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 7 replies
  • 161 views
  • 0 likes
  • 4 in conversation