Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Unable to extract format width and precision of SAS dataset #54

@rd-thomas-uhren

Description

@rd-thomas-uhren

I'm unable to extract the format specification; example attached.

I'm using the latest version 2.0.11.

class.zip

		FileInputStream in = null;
		
		try 
		{
			in = new FileInputStream("C:\\opt\\sas\\class.sas7bdat");
		} 
		catch (FileNotFoundException e) 
		{
			e.printStackTrace();
		}
		
		SasFileReader sasFileReader = new SasFileReaderImpl(in);
		
		List<Column> columns = sasFileReader.getColumns();

		for (Column c : columns) 
		{
			System.out.println(c.getName() + " | " + c.getFormat() + " | " + c.getFormat().getWidth() + " | " + c.getFormat().getPrecision());
		}

Resut:

Name | | 0 | 0
Sex | | 0 | 0
Age | | 0 | 0
Height | | 0 | 0
Weight | | 0 | 0

Properties from SAS EG:

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions