Sponsored Content
Full Discussion: SAS dataset to CSV
Top Forums UNIX for Advanced & Expert Users SAS dataset to CSV Post 303017807 by vbe on Wednesday 23rd of May 2018 03:33:40 AM
Old 05-23-2018
Quote:
Problem here is i have no clue how this sample.sas7bdat is generated.
Yes you do: generated by SAS, Its a SAS dataset and has a pendent file ending by sas7bcat...
To answer shortly it is like asking how to make a Excel .xlsx file into csv without using excel, it can be done only IF you know what you are looking for, as these files contain the structure of the spreadsheet and the data. You must know the content to know when the data records starts and end and you must know what they are and how they are organized because that part is what you see with special characters and so no hope for someone to guess
SAS has one thing I remember, it says somewhere how many records and variables are in the file, if that can help to check you have correctly found the data, I doubt it be enough the find the names of the variables...
In other words someone working with SAS knowing its structure etc.. could maybe be able but why would he when he can simply export from SAS the same you would from Excel to CSV ?
Did you check if Excel in latest versions cant import such file?
I did that once year back because I had a corrupted dataset, that was not converted form SAS 6 32 bit to SAS8 64, because it was forgotten and got not be read ( corrupt) it was a struggle BUT I had a statistician with me to help saying what the file was supposed to contain and described me the structure so I knew I had to find the first and last record and split the file in 3 then check if I had the all the data...

Quote:
if you try opening in unix this special character will come. I mean not in proper readable format
The same is true with Excel or WORD files, none of them are intended to be read with standard text editors like vi notepad, otherwise why would you pay $$$ for them other than having a load of advanced functions you dont use ( the basic are already sufficent...)...

Your only easy choice now is to find someone who uses SAS to convert it for you hoping you dont need the sas7bcat file... and your luck is these files are ASCII ( well could be UTF8 now if in SAS9 ) and are not dependant or architecture so a friend with SAS on a PC can do the job
This User Gave Thanks to vbe For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Accessing Mainframe Dataset

Hi May I know is there a way to read/copy a mainframe (IBM OS/390) dataset (sequential file) into a UNIX directory? Thank you for your time. IcyGuava (4 Replies)
Discussion started by: IcyGuava
4 Replies

2. Shell Programming and Scripting

Numbers of records in SAS dataset

I'm declaring a variable within a Korn shell to represent the total number of records in a SAS dataset and could use a little help with the syntax. This is what I have thus far: #!/usr/bin/ksh RecCount = `sas -x "select count(*) from /users/abc/123/sas_dataset.sas7bdat"` (2 Replies)
Discussion started by: sasaliasim
2 Replies

3. Programming

Finding number of records in SAS dataset

I am running the following Korn shell script: #!/usr/bin/ksh num_records=`sas "select count(*) from /users/abc/123/sasdata.sas7bdat"` echo "$num_records" The script keeps returning an invalid file error even though I am certain that the file really exists. Does anyone see anything wrong... (1 Reply)
Discussion started by: sasaliasim
1 Replies

4. Shell Programming and Scripting

Normalize a dataset with AWK

Hello everyone, i have to normalize this dataset (with 20.000 rows): 2,4,4,3,2,7,8,2,9,11,7,7,1,8,5,6 4,7,5,5,5,5,9,6,4,8,7,9,2,9,7,10 7,10,8,7,4,8,8,5,10,11,2,8,2,5,5,10 4,9,5,7,4,7,7,13,1,7,6,8,3,8,0,8,8 6,7,8,5,4,7,6,3,7,10,7,9,3,8,3,7,8 in this form:... (1 Reply)
Discussion started by: [raven]
1 Replies

5. Shell Programming and Scripting

Computing dataset for a specific record

Hello everybody, I want to compute a data file in awk. I am new in awk and I need your help. The data file has the following fields. It has thousands of records. Col1 Col2 Col3 Col4 Col5 0.85 0.07 Fre 42:86 25 0.73 0.03 frp 21:10 28 0.64... (12 Replies)
Discussion started by: ubeejani
12 Replies

6. Shell Programming and Scripting

How to extract a subset from a huge dataset

Hi, All I have a huge file which has 450G. Its tab-delimited format is as below x1 A 50020 1 x1 B 50021 8 x1 C 50022 9 x1 A 50023 10 x2 D 50024 5 x2 C 50025 7 x2 F 50026 8 x2 N 50027 1 : : Now, I want to extract a subset from this file. In this subset, column 1 is x10, column 2 is... (3 Replies)
Discussion started by: cliffyiu
3 Replies

7. Programming

Dataset Library for C?

I am looking for an opensource dataset library for C. Something equivalent to ADO.Net. Specifically, I am looking for the following features: 1. Create a Dataset from a file (XML or CSV). 2. Create a Dataset from a select query using an ODBC connection. 3. Load a created Dataset into a... (1 Reply)
Discussion started by: a_programmer
1 Replies

8. Solaris

flarecreate for zfs root dataset and ignore multiple dataset

Hi All, I want to write a script to create flar images on multiple servers. In non zfs filesystem I am using -X option to refer a file to exclude mounts on different servers. but on ZFS -X option is not working. I want multiple mounts to be ignore on ZFS base system during flarecreate. I... (0 Replies)
Discussion started by: uxravi
0 Replies

9. Solaris

ZFS - Dataset / pool name are the same...cannot destroy

I messed up my pool by doing zfs send...recive So I got the following : zpool list NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT rpool 928G 17.3G 911G 1% 1.00x ONLINE - tank1 928G 35.8G 892G 3% 1.00x ONLINE - So I have "tank1" pool. zfs get all... (8 Replies)
Discussion started by: eladgrs
8 Replies

10. UNIX for Advanced & Expert Users

How to extract subset file from dataset?

Hello I have a data set which looks like this : progeny sire dam gender 12 1 3 M 13 2 4 F 14 2 5 F 15 6 5 ... (13 Replies)
Discussion started by: sajmar
13 Replies
SMP_REP_PHY_ERR_LOG(8)						     SMP_UTILS						    SMP_REP_PHY_ERR_LOG(8)

NAME
smp_rep_phy_err_log - invoke REPORT PHY ERROR LOG SMP function SYNOPSIS
smp_rep_phy_err_log [--help] [--hex] [--interface=PARAMS] [--phy=ID] [--raw] [--sa=SAS_ADDR] [--verbose] [--version] [--zero] SMP_DEVICE[,N] DESCRIPTION
Sends a SAS Management Protocol (SMP) REPORT PHY ERROR LOG function request to a SMP target. The SMP target is identified by the SMP_DEVICE and the SAS_ADDR. Depending on the interface, the SAS_ADDR may be deduced from the SMP_DEVICE. The mpt interface uses SMP_DEVICE to iden- tify a HBA (an SMP initiator) and needs the additional ,N to differentiate between HBAs if there are multiple present. OPTIONS
Mandatory arguments to long options are mandatory for short options as well. -h, --help output the usage message then exit. -H, --hex output the response (less the CRC field) in hexadecimal. -I, --interface=PARAMS interface specific parameters. In this case "interface" refers to the path through the operating system to the SMP initiator. See the smp_utils man page for more information. -p, --phy=ID phy identifier. ID is a value between 0 and 254. Default is 0. -r, --raw send the response (less the CRC field) to stdout in binary. All error messages are sent to stderr. -s, --sa=SAS_ADDR specifies the SAS address of the SMP target device. Typically this is an expander. This option may not be needed if the SMP_DEVICE has the target's SAS address within it. The SAS_ADDR is in decimal but most SAS addresses are shown in hexadecimal. To give a number in hexadecimal either prefix it with '0x' or put a trailing 'h' on it. -v, --verbose increase the verbosity of the output. Can be used multiple times -V, --version print the version string and then exit. -z, --zero zero the Allocated Response Length field in the request. This option also zeros the Request Length field in the request. This is required for strict SAS-1.1 compliance. However this option should not be given in SAS-2 and later; if it is given an abridged response may result. NOTES
Similar information is maintained for SAS SSP target phys (e.g. on a SAS disk). It can be obtained from the Protocol Specific Port log page with the sg_logs utility. Similar information may be obtained for SAS initiator phys (e.g. on a SAS HBA). As an example in Linux 2.6.28 error information can be found in this directory /sys/class/sas_phy/phy-4:0 (for the phy 0 in SCSI/SAS host 4). Similar information may be obtained for SATA device phys (e.g. on a SATA disk). If there is a SAT layer between OS and the SATA device then the sg_sat_phy_event utility can fetch the information. CONFORMING TO
The SMP REPORT PHY ERROR LOG function was introduced in SAS-1 . The "Expander change count" field was added in SAS-2 . AUTHORS
Written by Douglas Gilbert. REPORTING BUGS
Report bugs to <dgilbert at interlog dot com>. COPYRIGHT
Copyright (C) 2006-2011 Douglas Gilbert This software is distributed under a FreeBSD license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR- POSE. SEE ALSO
smp_utils, smp_phy_control(smp_utils), sg_logs(sg3_utils), sg_sat_phy_event(sg3_utils) smp_utils-0.96 May 2011 SMP_REP_PHY_ERR_LOG(8)
All times are GMT -4. The time now is 06:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy