Sponsored Content
Top Forums Shell Programming and Scripting Numbers of records in SAS dataset Post 302187610 by sasaliasim on Monday 21st of April 2008 02:27:26 PM
Old 04-21-2008
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"`
 

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

3. UNIX for Dummies Questions & Answers

seperating records with numbers from a set of numbers

I have two files one (numbers file)contains the numbers(approximately 30000) and the other file(record file) contains the records(approximately 40000)which may or may not contain the numbers from that file. I want to seperate the records which has the field 1=(any of the number from numbers... (15 Replies)
Discussion started by: Shiv@jad
15 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

how to delete records with the given line numbers

I have a file which has about 10000 records and I need to delete about 50 records from the file. I know line numbers and am using sed '134,1357,......d' filename > new file. It does not seem to be working. Please Advice (5 Replies)
Discussion started by: mad_man12
5 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. Shell Programming and Scripting

replace numbers in records

hello every one I have file with following records begin ASX120016719 ASX190006729 ASX153406729 ASX190406759 ASX180006739 end for each record there is ASX word then 9 digits after it (NO spaces included) what i want is to : 1- skip ASX 2-skip first 2 digits after ASX word... (16 Replies)
Discussion started by: neemoze
16 Replies

10. UNIX for Advanced & Expert Users

SAS dataset to CSV

Hi Guys, Is there a way to export a sas file i.e .sas7bdat file to .csv file with header and data using unix. I dont want to use SAS program instead using unix tool or unix scripting is it possible ? (25 Replies)
Discussion started by: Master_Mind
25 Replies
H5MATH(1)							      h5utils								 H5MATH(1)

NAME
h5math - combine/create HDF5 files with math expressions SYNOPSIS
h5math [OPTION]... OUTPUT-HDF5FILE [INPUT-HDF5FILES...] DESCRIPTION
h5math takes any number of HDF5 files as input, along with a mathematical expression, and combines them to produce a new HDF5 file. HDF5 is a free, portable binary format and supporting library developed by the National Center for Supercomputing Applications at the Uni- versity of Illinois in Urbana-Champaign. A single h5 file can contain multiple data sets; by default, h5math creates a dataset called "h5math", but this can be changed via the -d option, or by using the syntax HDF5FILE:DATASET. The -a option can be used to append new datasets to an existing HDF5 file. The same syntax is used to specify the dataset used in the input file(s); by default, the first dataset (alphabetically) is used. A simple example of h5math's usage is: h5math -e "d1 + 2*d2" out.h5 foo.h5 bar.h5:blah which produces a new file, out.h5, by adding the first dataset in foo.h5 with twice the "blah" dataset in bar.h5. In the expression (spec- ified by -e), the first input dataset (from left to right) is referred to as d1, the second as d2, and so on. In addition to input datasets, you can also use the x/y/z coordinates of each point in the expression, referenced by "x" "y" and "z" vari- ables (for the first three dimensions) as well as a "t" variable that refers to the last dimension. By default, these are integers start- ing at 0 at the corner of the dataset, but the -0 option will change the x/y/z origin to the center of the dataset (t is unaffected), and the -r res option will specify the "resolution", dividing the x/y/z coordinates by res. All of the input datasets must have the same dimensions, which are also the dimensions of the output. If there are no input files, and you are defining the output purely by a mathematical formula, you can specify the dimensions of the output explicitly via the -n size option, where size is e.g. "2x2x2". Sometimes, however, you want to use only a smaller-dimensional "slice" of multi-dimensional data. To do this, you specify coordinates in one (or more) slice dimension(s), via the -xyzt options. OPTIONS
-h Display help on the command-line options and usage. -V Print the version number and copyright info for h5math. -v Verbose output. -a If the HDF5 output file already exists, append the data as a new dataset rather than overwriting the file (the default behavior). An existing dataset of the same name within the file is overwritten, however. -e expression Specify the mathematical expression that is used to construct the output (generally in " quotes to group the expression as one item in the shell), in terms of the variables for the input datasets and the coordinates as described above. Expressions use a C-like infix notation, with most standard operators and mathematical functions (+, sin, etc.) being supported. This functionality is provided (and its features determined) by GNU libmatheval. -f filename Name of a text file to read the expression from, if no -e expression is specified. Defaults to stdin. -x ix, -y iy, -z iz, -t it This tells h5math to use a particular slice of a multi-dimensional dataset. e.g. -x uses the subset (with one less dimension) at an x index of ix (where the indices run from zero to one less than the maximum index in that direction). Here, x/y/z correspond to the first/second/third dimensions of the HDF5 dataset. The -t option specifies a slice in the last dimension, whichever that might be. See also the -0 option to shift the origin of the x/y/z slice coordinates to the dataset center. -0 Shift the origin of the x/y/z slice coordinates to the dataset center, so that e.g. -0 -x 0 (or more compactly -0x0) returns the central x plane of the dataset instead of the edge x plane. (-t coordinates are not affected.) This also shifts the origin of the x/y/z variables in the expression so that 0 is the center of the dataset. -r res Use a resolution res for x/y/z (but not t) variables in the expression, so that the data "grid" coordinates are divided by res. The default res is 1. For example, if the x dimension has 21 grid steps, setting a res of 20 will mean that x variables in the expression run from 0.0 to 1.0 (or -0.5 to 0.5 if -0 is specified), instead of 0 to 20. -r does not affect the coordinates used for slices, which are always integers. -n size The output dataset must be the same size as the input datasets. If there are no input datasets (if you are defining the output purely by a formula), then you must specify the output size manually with this option: size is of the form MxNxLx... (with M, N, L being integers) and may be of any dimensionality. -d name Write to dataset name in the output; otherwise, the output dataset is called "data" by default. Also use dataset name in the input; otherwise, the first input dataset (alphabetically) in a file is used. Alternatively, use the syntax HDF5FILE:DATASET (which over- rides the -d option). BUGS
Send bug reports to S. G. Johnson, stevenj@alum.mit.edu. AUTHORS
Written by Steven G. Johnson. Copyright (c) 2005 by the Massachusetts Institute of Technology. h5utils May 23, 2005 H5MATH(1)
All times are GMT -4. The time now is 05:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy