SAS-Export - SAS Export SAS Last Updated 29 June 2004...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
SAS Export SAS Export Last Updated : 29 June, 2004 Center of Excellence Data Warehousing
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Objectives   Write  observations  from  a  SAS  data  set  to  a  comma-delimited external file.  Use DATA step logic to insert a header record and a footer record into an external file.
Background image of page 2
Introduction You can use the DATA step to write a custom report data to an external file to be read by other programming  languages or software.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Introduction The INPUT statement describes the arrangement of values in the input data record. The INFILE statement identifies an external file to read with an INPUT statement. The DATA statement begins the DATA step. READING FROM AN EXTERNAL FILE The PUT statement describes the arrangement of values in the output data record. The FILE statement identifies an external file to write with a PUT statement. The DATA statement begins the DATA step. WRITING TO AN EXTERNAL FILE
Background image of page 4
The DATA Statement Usually, the DATA statement specifies at least one data set name that the SAS System uses to create an output data set.  Using the keyword _NULL_ as the data set name causes  SAS  to  execute  the  DATA  step  without writing observations to a data set. DATA _NULL_;
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The FILE Statement The  FILE  statement  can  be  used  to  specify  the  output  destination  for  subsequent  PUT  statements. General form of the FILE statement: You  can  use  the  FILE  statement  in  conditional  processing (IF-THEN/ELSE or SELECT) because it  is executable. FILE file-specification < options >;
Background image of page 6
The PUT Statement The PUT statement can write lines to the external  file that is specified in the most recently executed  FILE statement. General form of the PUT statement: With simple list output, you list the names of the  variables whose values you want written. The PUT  statement writes a variable value, inserts a single  blank, and then writes the next value.  PUT variable-1 variable-2 … variable-n ;
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Modified List Output Modified list output increases the versatility of the  PUT  statement  because  you  can  specify  a  SAS  format  to  control  how  the  variable  values  are  written. To  use  modified  list  output,  use  the  colon  (:)  format modifier in the PUT statement between the  variable name and the format.  PUT variable-1 : format-1. variable-2 : format-2. variable-n : format-n. ; . . .
Background image of page 8
Writing to an External File The prog2.maysales data set contains information  about houses. Read this data set and write the  data to an external file. List
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/08/2010 for the course USE 3425 taught by Professor Raman during the Spring '10 term at Punjab Engineering College.

Page1 / 35

SAS-Export - SAS Export SAS Last Updated 29 June 2004...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online