BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mannavak
Calcite | Level 5

Please help me how to avoid sas changing the slashes in the code to a special character in the log. Is there any option I should use in the beginning of my sas programming?

1 ACCEPTED SOLUTION

Accepted Solutions
RichardDeVen
Barite | Level 11

Going over the log more, the likely culprit is 

 

NOTE: Data file C.CAREFORMAT1920.DATA is in a format that is native to another host, or the file encoding does not match the
session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce
performance.

ERROR: Some character data was lost during transcoding in the dataset C.CAREFORMAT1920. Either the data contains characters that
are not representable in the new encoding or truncation occurred during transcoding.

View solution in original post

9 REPLIES 9
PaigeMiller
Diamond | Level 26

Show us what you mean. Show us the code. Show us the log. Paste the code as text into the box that appears when you click on the running man icon. Paste the log as text int on the box that appears when you click on the </> icon. Do not use file attachments.

--
Paige Miller
mannavak
Calcite | Level 5
34 libname f "H:\CA\CA19\Documents Used for Report";

NOTE: Libref F was successfully assigned as follows:

Engine: V9

Physical Name: H:\CA\CA19\Documents Used for Report

35 *'S:\2017-2018 Sch Asmt\Assessments\CA17\Final Reports\Documents Used to Created Final Reports';

35 ! *--location where

36 we want SAS to store SAS datafile;

37 libname C "H:\Temporary SAS Output";

NOTE: Libref C was successfully assigned as follows:

Engine: V9

Physical Name: H:\Temporary SAS Output

38

39 *'S:\';

40 *---Change Year;

41 %let yr=2019;

42 *--Change School Year;

43 %let schyr=1920;

44 *--Change location of raw data file ;

45 %let folder= H:\CA\CA19\Documents Used for Report\;

46 *S:\2017-2018 Sch Asmt\ Assessments\CA17\Final Reports\Documents Used to Created Final Reports\;

47 *--Change File;

48 %let rawdatafile=CCAll_08212020.xlsx; *--cleaned tab used in xls;

49

50

51 *Raw SAS datafile;

52 proc contents data=f.ccall&schyr;

NOTE: Writing HTML Body file: sashtml.htm

53 title "Contents CCAll&schyr";

54 run;

NOTE: PROCEDURE CONTENTS used (Total process time):

real time 1.34 seconds

cpu time 0.29 seconds

55

56 *--rename and create variables;

57 data c.careformat&schyr(drop=/* mz_physzip mz_mailzip*/ mz_cocode mz_facilitycode); /*drop variable with missing zero*/;

58 length cocode $2 facilitycode $9;/* mailzip $5 physzip $5*/

59 set f.CCALL&schyr(rename=

60 ( /*mailzip=mz_mailzip physzip=mz_physzip*/

61 cocode=mz_cocode facilitycode=mz_facilitycode

62 /*SCHCODE=facilitycode*/

63 All_required=allreq

64 XXX=PBE

65 YYY=cond

66 ZZZ=total

67 _Exemption=PME

68 _Exemption=TME

69 =IEPService

70

78

79 ));

80

81 *--apply z. format to numeric value to make it character and restore missing leading zeroes;

82 cocode = put (mz_cocode, z2.);

83 facilitycode=put(mz_facilitycode, z9.);

84 /*mailzip = put (mz_mailzip, z5.);

85 physzip = put (mz_physzip, z5.); */

86

87 *--populate missing facilitytype;

88 if reportingstatus='Not Reported' and facilitytype=' ' then facilitytype='UNKNOWN';

89 run;

NOTE: Data file C.CAREFORMAT1920.DATA is in a format that is native to another host, or the file encoding does not match the

session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce

performance.

ERROR: Some character data was lost during transcoding in the dataset C.CAREFORMAT1920. Either the data contains characters that

are not representable in the new encoding or truncation occurred during transcoding.

NOTE: The DATA step has been abnormally terminated.

NOTE: The SAS System stopped processing this step because of errors.

NOTE: There were 1490 observations read from the data set F.CCALL1920.

WARNING: The data set C.CAREFORMAT1920 may be incomplete. When this step was stopped there were 1489 observations and 47

variables.

WARNING: Data set C.CAREFORMAT1920 was not replaced because this step was stopped.

NOTE: DATA statement used (Total process time):

real time 15.87 seconds

cpu time 0.14 seconds
PaigeMiller
Diamond | Level 26

I don't see anywhere that a special character appears. Please point it out for me.

--
Paige Miller
mannavak
Calcite | Level 5
I am also looking into it. I don't see any problem here. Might be there is a display problem. Thank you @ Paige Miller
ballardw
Super User

@mannavak wrote:
I am also looking into it. I don't see any problem here. Might be there is a display problem. Thank you @ Paige Miller

Try pasting into a code box opened with the </>. Copy directly from the log and the paste into the code box.

The main message windows are likely going to treat your pasted text as HTML and will reformat text to remove white space. Font issues on conversion are also problematic.

 

mannavak
Calcite | Level 5

Thank you. 

for the time being, I created a work dataset from the dataset from another platform which I am reading. That's solving the problem temporarily.

Looks like that's the culprit.

ballardw
Super User

Now, show us exactly where a slash was turned into a special character.

Best would be to copy  the Code, indicating just which slash is involved,

Then from the LOG, best pasted into a code box on the forum, opened using the </> icon, directly after copying from the log to preserve formatting, and again show or indicate which slash was changed.

 

I see lots of slashes in that log entry so it is extremely hard to guess what may have started as a slash that appears differently in the log.

 

RichardDeVen
Barite | Level 11

Presuming this issue is in desktop SAS.

 

The Editor and LOG window may be using different fonts for displaying their content.

 

If the Editor window (Enhanced Editor) and the LOG window have different fonts, some characters (above '7f'x) may appear differently.

 

Enhanced Editor window font setting (whilst Editor window active)

- Tools / Options > Enhanced Editor, Font section Name: drop down will show you the setting

- or use command EDCMD CUSTOMIZE

 

LOG window font setting (whilst LOG window active)

Tools / Options > Fonts will show you the current font setting

- or use command DLGFONT

RichardDeVen
Barite | Level 11

Going over the log more, the likely culprit is 

 

NOTE: Data file C.CAREFORMAT1920.DATA is in a format that is native to another host, or the file encoding does not match the
session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce
performance.

ERROR: Some character data was lost during transcoding in the dataset C.CAREFORMAT1920. Either the data contains characters that
are not representable in the new encoding or truncation occurred during transcoding.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 9 replies
  • 1598 views
  • 1 like
  • 4 in conversation