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

Hello Everybody!

I´m using Dataflux DMStudio 2.6 to read those values below:

 

"asString";"asInteger"
"A001127209";"A001127209"
"000379043B";"000379043B"
"00085351C6";"00085351C6"
"0014479443";"0014479443"

 

Case A. Reading from a txt file containing that lines:

 

I read the first column (Field Name asString) as an STRING(10) field type, and the second column as an INTEGER(10) field type.

000.PNG 

 

In that case, when I preview the data the results are:

001.PNG

1 - Generates a "0" result;

2 - Preserve only the left significative numeric characters (379043),

3 - Preserve only the left significative numeric characters (85351),

4 - Preserve only the left significative numeric characters, in that case, the real value.

 

Case B. Reading as a Job Specific Data:

 

 

002.PNG

 

In that case, when I preview the data the results are:

 

004.PNG

 

1 - Generates a "null" result;

2 - Preserve only the left significative numeric characters (379043),

3 - Preserve only the left significative numeric characters (85351),

4 - Preserve only the left significative numeric characters, in that case, the real value.

 

So, I´d like to understand:

a) Why Dataflux accepts an alphanumeric value (even part of it) as a input of an Integer field? 
b) Why not treat all alphanumeric strings as "null" results?
c) Why Dataflux treats the first string in different ways when reading a file and for Job Specific Data ( "0" x "null" )?
d) Where can I find documentation for content transformation between different field types?

 

I welcome any information that helps to clarify this situation.

 

Thank you all.

Luís Leite


 

1 ACCEPTED SOLUTION

Accepted Solutions
andrew_s
SAS Employee
Luis, the documentation does not appear to be too detailed in this regard. This is some information from the code which generally applies to these types of transformations (and as you have noted, there seems to be an exception in the Job Specific Data node):
String -> integer - Read the first characters until a non-numeric value is found. The integer is the digits read.
String-> Real - Same as integer, but allows a decimal point (Which must be a '.' Character)
String -> Date - String is parsed, and the components are analyzed. If there is ambiguity between month and day, it will either use what you specify (ie in text input or job specific data node) or it will use your locale setting.
String -> Boolean - Will look for values true, t, yes, y, on to represent true and false, f, no, n, off to represent false

View solution in original post

4 REPLIES 4
andrew_s
SAS Employee

Luis,what you have identified is unfortunately some disparate behaviour between these two components. It would be good if they behaved the same, but unfortunately they do not. The text file node will read until the first non-numeric character, and the job specific data will issue null if it finds a non-numeric value. It's possible that this will be fixed in a future version.

LuisLeiteBR
Obsidian | Level 7

Ok Andrew!!

Would you know where can I find any kind of documentation about this flield type transformation?
i.e. between Integer, Strings, Real, Boolean, etc...

Thank´s a lot!

andrew_s
SAS Employee
Luis, the documentation does not appear to be too detailed in this regard. This is some information from the code which generally applies to these types of transformations (and as you have noted, there seems to be an exception in the Job Specific Data node):
String -> integer - Read the first characters until a non-numeric value is found. The integer is the digits read.
String-> Real - Same as integer, but allows a decimal point (Which must be a '.' Character)
String -> Date - String is parsed, and the components are analyzed. If there is ambiguity between month and day, it will either use what you specify (ie in text input or job specific data node) or it will use your locale setting.
String -> Boolean - Will look for values true, t, yes, y, on to represent true and false, f, no, n, off to represent false

LuisLeiteBR
Obsidian | Level 7
Thank´s Andrew!!!
It´s never too late ...

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1186 views
  • 0 likes
  • 2 in conversation