Transferring SAS@Data Sets with the Xcopy Procedure

Total Page:16

File Type:pdf, Size:1020Kb

Transferring SAS@Data Sets with the Xcopy Procedure Transferring SAS@Data Sets With The XCOpy Procedure Tom Miron Systems Seminar Consultants, Madison, WI 608/222-7081 ABSTRACT It is often desirable to transfer SAS datasets There are a number of reasons to transfer SAS between different systems, between, say, a CMS datasets between an OS mainframe and a Pc. SAS mainframe computer and a pc. There are several provides PROC UPLOAD and DOWNLOAD to reasons why you may want to do this: facilitate this transfer. While UPLOAD and DOWNLOAD are convenient and relatively it's more convenient to use the PC for straightforward they are not as efficient in terms of processing system resources as native file transfer programs such as IBM's IND$FILE. This efficiency difference there may be output devices that are only can be significant when transferring large SAS available on the host system or on your PC datasets. In addition, UPLOAD and DOWNLOAD work via interactive SAS on the host system. Users your SAS based application may have with limited access to interactive SAS may not be outgrown the capacity of your PC able use UPLOAD and DOWNLOAD to transfer files. the source of your data may have changed. This paper describes an alternative method of There are a couple ways to transfer SAS datasets transferring SAS datasets using PROC XCOPY on the between systems. The most familiar is probably host end, and PROC COPY and LlBNAME with the the use of PROC UPLOAD and PROC SASV5XPT option on the PC end. Actual data DOWNLOAD. These PROC's allow the direct transfer is accomplished with the system native file transfer of datasets from one system to another. transfer program. This method of copying SAS Unfortunately, UPLOAD/DOWNLOAD may not be datasets from the host to PC allows for minimum available to all SAS users. cost and allows users that do not have access to interactive SAS on the host to use host data on their If foreground SAS is not available on your host PC's. The method can be useful in certain data computer system you cannot use gathering applications as well. UPLOAD/DOWNLOAD. These PROC's require a link between concurrent SAS sessions on the host and a pc. What, Why, How? Some users may have foreground SAS available on the host but do not have a communications link This paper describes a method for transferring SAS between the PC and the host that is supported by datasets between mainframe or mini computers the SAS RLiNK software. In either case you can running SAS Ver 5 and PC's running SAS Ver 6.03. still transfer SAS datasets via the XCOPY method described below. 922 This method can also be useful for transferring There are three things to note here: large amounts of data since it uses "native" file transfer methods that are usually faster than 1 . use the EXPORT option on PROC UPLOAD/DOWNLOAD. XCOpy 2. make sure the OUT = file is defined The XCOPY Method as RECFM F (record format is fixed) and lRECL 80 (record length is 80 The XCOPY method for transferring SAS datasets characters or bytes) requires only that you have SAS Ver S running on 3. you can select SAS datasets to your host system, have PC SAS Ver 6 on your PC, XCOpy into the transport library and have a means of transferring files between the with the SELECT statement. two. This file transfer method must support binary transfer. Binary transfer simply means that the You must use these RECFM and LRECL options transfer software does not attempt to change or (RECFM of FB, fixed block, is also acceptable). translate the data in any way: no translation from EBCDIC to ASCII (or vice versa) and no insertion of carriage return and linefeed (CRLF) characters at File Transfer the end of "lines" of data. After running the XCOPY SAS program you will The XCOPY method relies on 2 features of the SAS have a SAS "transport" format dataset in a file system: named HOST DATA A. The next step is to transfer this to your Pc. 1. PROC XCOPY 2. the SASV5XPT option of the LlBNAME If you are using the IBM IND$FILE transfer progr<lm statement. your would execute: Let's see how it works ... RECEIVE C:\TRANS.DAT HOST DATA A Downloading with XCOPY on your Pc. This command will transfer HOST DATA A to a PC file called TRANS.DAT in the root The examples used below are for an IBM CMS directory of the C: drive. For those familiar with host system but would be similar for IBM MVS/OS the IND$FILE SEND and RECEIVE command, note system and mini computer hosts. For MVS that you do not use the ASCII and CRlF substitute TSO ALlOC or JCL DD statements for parameters ... this is a binary file transfer. CMS FILEDEF's. You can use any PC file name. The first step is to translate your host SAS datasets to the transport format: You can use any file transfer method (your site may not have IND$FllE SEND and RECEIVE. The CMS FILEDEF TRANS DISK only requirement is that the file transfer you do use HOST DATA A (RECFM F LRECL 80; is capable of a binary file transfer. PROC XCOPY IN=SASDATA OUT=TRANS EXPORT; SELECT MYDS; /* optional */ RUN; 923 Convert to PC SAS make a transport format. copy of the dataset in the MS-DOS file TRANS.DAT in the root directory of The final step is to convert the transport dataset the C: drive. downloaded from the host into a standard Ver 6 SAS dataset. The following program, run on the Again, you can use any DOS file name or libname PC that received the transport dataset from the you want, and you can SELECT one or more host, will do the conversion: datasets from a library. The important thing is the use of SASV5XPT and the use of a full FILESPEC LIBNAME FROMHOST SASV5XPT when defining the output libname. 'C:\TRANS.DAT' ; LIBNAME MYLIB 'C:\SSD'; Transfer up PROC COpy IN=FROMHOST OUT=MYLIB; The next upload step is file transfer. An example: SELECT MYDS; /* optional */ RUN; SEND C:\TRANS.DAT HOST DATA A (RECFM F LRECL 80 There are four things to note about this program: And again, note that you do not specify the ASCII or CRLF parms. You do specify the RECFM F and 1. use the SASV5XPT option on the LlBNAME LRECL 80 parms if you are creating a new dataset statement on the host via the file transfer. If you do not use IND$FILE SEND and RECEIVE just make sure you 2. the input libname points at an MS-DOS specify a binary file transfer for the method you do FILESPEC not a directory use and insure that the receiving file on the host has a RECFM of F and LRECL of 80. 3. you can select individual datasets from several that may be in the transport library Converting uploads to Ver 5 4. you can use any valid libname you like. The following program, run on the host system that received the uploaded transport library, will Uploading convert that library into the standard SAS Ver 5 format: Uploading SAS datasets from the PC to a host system is essentially the same process in reverse. CMS FILEDEF FROMPC DISK HOST DATA A; First, convert a PC SAS dataset(s) to the transport format: PROC XCOPY IN=FROMPC OUT=MYLIB IMPORT; LI BNAME FROMPC SASV5XPT SELECT SOMEDATA; 'C:\TRANS.DAT' ; RUN; LIBNAME MYLIB 'C:\SSD'; Note the use of the IMPORT option with PROC XCOPY and the fact that you can SELECT datasets PROC COpy IN=MYLIB OUT=FROMPC; from the transport library. SELECT SOMEDATA; RUN; This program, run on the PC holding the dataset you want to upload (MYLlB.50MEDATA), will 924 Rules SAS documentation When using the XCOPY method remember these "SAS Language Guide for Personal Computers rules: Release 6.03" 1 . Use PROC XCOPY on the host and PROC pages 514-515 COPY on the pc. LlBNAME with the SASV5XPT option 2. When sending datasets from the host to the PC use the PROC XCOPY option EXPORT. 3. When receiving datasets from the PC on the "SAS Procedures Guide Release 6.03" host use the PROC XCOPY option IMPORT. pages 121-124 4. The transport library on the host system must be RECFM F and LRECL 80, i.e., fixed record PROC COPY format and record length of 80. "SAS User's Guide: Basics Version 5 Edition" 5. Always use binary file transfer. No ASCII pages 1193-1199 translation or CRLF insertions. PROC XCOPY 6. On the PC always use the SASV5XPT option on the LlBNAME statement that defines the transport format library. 7. The LlBNAME statement that defines the transport format library on the PC (imported or exported) must point at a full DOS FILESPEC not just a directory as with the standard usage. ZAPS may be required! You may have to apply the following ZAPS to SAS Ver 6.03 before using the XCOPY method: if transferring to or from an MVS/OS host Z6030870 if transferring from a VMS host Z6030988 925 .
Recommended publications
  • This Document Explains How to Copy Ondemand5 Data to Your Hard Drive
    Copying Your Repair DVD Data To Your Hard Drive Introduction This document explains how to copy OnDemand5 Repair data to your hard drive, and how to configure your OnDemand software appropriately. The document is intended for your network professional as a practical guide for implementing Mitchell1’s quarterly updates. The document provides two methods; one using the Xcopy command in a DOS window, and the other using standard Windows Copy and Paste functionality. Preparing your System You will need 8 Gigabytes of free space per DVD to be copied onto a hard drive. Be sure you have the necessary space before beginning this procedure. Turn off screen savers, power down options or any other program that may interfere with this process. IMPORTANT NOTICE – USE AT YOUR OWN RISK: This information is provided as a courtesy to assist those who desire to copy their DVD disks to their hard drive. Minimal technical assistance is available for this procedure. It is not recommended due to the high probability of failure due to DVD drive/disk read problems, over heating, hard drive write errors and memory overrun issues. This procedure is very detailed and should only be performed by users who are very familiar with Windows and/or DOS commands. Novice computers users should not attempt this procedure. Copying Repair data from a DVD is a time-consuming process. Depending on the speed of your processor and/or network, could easily require two or more hours per disk. For this reason, we recommend that you perform the actual copying of data during non-business evening or weekend hours.
    [Show full text]
  • 1. Xcopy 2. No, You Cannot Use the Xcopy Command in Your Assignment
    Intro to Operating Systems CNET 173 Assignment #4 Windows / LINUX Command Line Commands You are to list twenty-five command line commands of each operating system (WINDOWS and LINUX). That’s twenty- five WINDOWS commands and twenty-five LINUX commands. For each command you are to give: 1. The command a. Description/Attribute of the command b. Syntax of the command and c. A maximum of five Parameters used with the command and a description of the parameter. (If there are less than five parameters, list all parameters associated with the command.) Each command should be numbered and grouped (all WINDOWS commands with WINDOWS commands). Command information should be listed in the 1, a, b, c order listed above (i.e. command, description, syntax and parameters). This assignment must be typed and submitted through CANVAS. It should include a title page consisting of your name, course name, number, day and time, assignment name, instructor’s name, and due date and the assignment instructions. Example listed below. Windows Command Line Commands 1. xcopy a) Description - Copies files and directories, including subdirectories. b) Syntax xcopy Source [Destination] [/w] [/p] [/c] [/v] [/q] [/f] [/l] [/g] [/d[:mm-dd-yyyy]] [/u] [/i] [/s [/e]] [/t] [/k] [/r] [/h] [{/a|/m}] [/n] [/o] [/x] [/exclude:file1[+[file2]][+[file3]] [{/y|/-y}] [/z] c) Parameters /w : Displays the following message and waits for your response before starting to copy files: Press any key to begin copying file(s) /p : Prompts you to confirm whether you want to create each destination file. /c : Ignores errors. /v : Verifies each file as it is written to the destination file to make sure that the destination files are identical to the source files.
    [Show full text]
  • How to Cheat at Windows System Administration Using Command Line Scripts
    www.dbebooks.com - Free Books & magazines 405_Script_FM.qxd 9/5/06 11:37 AM Page i How to Cheat at Windows System Administration Using Command Line Scripts Pawan K. Bhardwaj 405_Script_FM.qxd 9/5/06 11:37 AM Page ii Syngress Publishing, Inc., the author(s), and any person or firm involved in the writing, editing, or produc- tion (collectively “Makers”) of this book (“the Work”) do not guarantee or warrant the results to be obtained from the Work. There is no guarantee of any kind, expressed or implied, regarding the Work or its contents.The Work is sold AS IS and WITHOUT WARRANTY.You may have other legal rights, which vary from state to state. In no event will Makers be liable to you for damages, including any loss of profits, lost savings, or other incidental or consequential damages arising out from the Work or its contents. Because some states do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you. You should always use reasonable care, including backup and other appropriate precautions, when working with computers, networks, data, and files. Syngress Media®, Syngress®,“Career Advancement Through Skill Enhancement®,”“Ask the Author UPDATE®,” and “Hack Proofing®,” are registered trademarks of Syngress Publishing, Inc.“Syngress:The Definition of a Serious Security Library”™,“Mission Critical™,” and “The Only Way to Stop a Hacker is to Think Like One™” are trademarks of Syngress Publishing, Inc. Brands and product names mentioned in this book are trademarks or service marks of their respective companies.
    [Show full text]
  • Falcon DOS Portable Terminals Advanced User's Guide
    ! " #$% & " ' ()**%++,,,&% & " !"# $ $ % &' $ % ( ( % )*+ (*,' (% $ )(+ $ - !!. !!/$ 0 1 2 + + 2 3'4 0 5 -../ .+ 0 % &6 (*, % $ & & &/,( % & & ( &/,( 0 &(*, % & ! "#$%#$&#'%#'&( !! ! )!* 0 $ $ 0 3&7 4 8 $ 9 8 % 2 $ : $ 1 0 ; < $ ; * $ , . % $ / ) = ) $ # 0 , $ # 0 ( ( " & > 0 & > ? ! % , < 9 $ ; 0 ++ . 0 + = 0 & 2
    [Show full text]
  • Older Operating Systems
    Older Operating Systems Class Notes # 10 Batch Files (Part 2) October 23, 2003 IF Condition When a given condition is true, the statement is executed. When the given condition is false, the statement is not executed. Figure one illustrates the flow chart for the IF condition. IF entry point No Decision Yes Statement (perform some action) IF exit point Figure 1: IF condition flow chart The IF condition tests the following three conditions: • The ERRORLEVEL of a program • Whether a string is equal to another string • Whether a file exists Using IF to test ERRORLEVEL The syntax for testing the ERRORLEVEL is: IF ERRORLEVEL number command This form of the IF condition determines whether the value of ERRORLEVEL is greater than or equal to a number specified in the number parameter. IF NOT ERRORLEVEL number command This form of the IF condition determines whether the value of ERRORLEVEL is not greater than or equal to a number specified in the number parameter. 1 If the specified condition is true, DOS executes the command specified in the command parameter. Otherwise, DOS skips to the next line in the batch file without executing the command in the command parameter. The only DOS commands that leave an ERRORLEVEL (exit) code are: BACKUP, DISKCOMP, DISKCOPY, FORMAT, GRAFTABL, KEYB, REPLACE, RESTORE, and XCOPY. Many other programs generate exit codes, however. For example, table one contains codes that are generated by the DISKCOPY command. Table one: DISKCOPY codes Code Description 0 The operation was successful. 1 A read/write error occurred that did not terminate the disk copy operation.
    [Show full text]
  • External Commands
    5/22/2018 External commands External commands Previous | Content | Next External commands are known as Disk residence commands. Because they can be store with DOS directory or any disk which is used for getting these commands. Theses commands help to perform some specific task. These are stored in a secondary storage device. Some important external commands are given below- MORE MOVE FIND DOSKEY MEM FC DISKCOPY FORMAT SYS CHKDSK ATTRIB XCOPY SORT LABEL 1. MORE:-Using TYPE command we can see the content of any file. But if length of file is greater than 25 lines then remaining lines will scroll up. To overcome through this problem we uses MORE command. Using this command we can pause the display after each 25 lines. Syntax:- C:\> TYPE <File name> | MORE C:\> TYPE ROSE.TXT | MORE or C: \> DIR | MORE 2. MEM:-This command displays free and used amount of memory in the computer. Syntax:- C:\> MEM the computer will display the amount of memory. 3. SYS:- This command is used for copy system files to any disk. The disk having system files are known as Bootable Disk, which are used for booting the computer. Syntax:- C:\> SYS [Drive name] C:\> SYS A: System files transferred This command will transfer the three main system files COMMAND.COM, IO.SYS, MSDOS.SYS to the floppy disk. 4. XCOPY:- When we need to copy a directory instant of a file from one location to another the we uses xcopy command. This command is much faster than copy command. Syntax:- C:\> XCOPY < Source dirname > <Target dirname> C:\> XCOPY TC TURBOC 5.
    [Show full text]
  • Storage Data Movement Offload
    Storage Data Movement Offload Frederick Knight NetApp 2011 Storage Developer Conference. © NetApp. All Rights Reserved. Storage Data Movement Offload What is Storage Data Movement Offload? Why is it important? What are the uses? How does it work? 2011 Storage Developer Conference. © NetApp. All Rights Reserved. 2 Moving Data the old way READ DATA STATUS WRITE DATA STATUS READ HOST STORAGE DATA STATUS WRITE DATA STATUS 2011 Storage Developer Conference. © NetApp. All Rights Reserved. 3 What Is It? Storage Data Movement Offload Also called - Copy Offload Storage device copies the data Data does not move through the host Two Techniques Single command current data copy Multi-command Read/Write model 2011 Storage Developer Conference. © NetApp. All Rights Reserved. 4 Why Is It Important? Copies data faster Saves bandwidth for real work Saves I/O bus (fabric/network) bandwidth Saves host I/O adapter bandwidth Saves host memory bandwidth Offloads work from the host to storage Gets you back to real work faster 2011 Storage Developer Conference. © NetApp. All Rights Reserved. 5 How Copy Offload works Copy Manager in the device Manages the movement of the data Two models of operation EXTENDED COPY (XCOPY) operations TOKEN based operations 2011 Storage Developer Conference. © NetApp. All Rights Reserved. 6 How XCOPY works Copy Manager in the device Manages the movement of the data Operates on data currently in the blocks EXTENDED COPY command provides: Identifiers for the Logical Units The SRC starting LBA The DST starting LBA The length A whole lot more optional stuff (including tapes) 2011 Storage Developer Conference. © NetApp. All Rights Reserved.
    [Show full text]
  • Ch 7 Using ATTRIB, SUBST, XCOPY, DOSKEY, and the Text Editor
    Using ATTRIB, SUBST, XCOPY, DOSKEY, and the Text Editor Ch 7 1 Overview The purpose and function of file attributes will be explained. Ch 7 2 Overview Utility commands and programs will be used to manipulate files and subdirectories to make tasks at the command line easier to do. Ch 7 3 Overview This chapter will focus on the following commands and programs: ATTRIB XCOPY DOSKEY EDIT Ch 7 4 File Attributes and the ATTRIB Command Root directory keeps track of information about every file on a disk. Ch 7 5 File Attributes and the ATTRIB Command Each file in the directory has attributes. Ch 7 6 File Attributes and the ATTRIB Command Attributes represented by single letter: S - System attribute H - Hidden attribute R - Read-only attribute A - Archive attribute Ch 7 7 File Attributes and the ATTRIB Command NTFS file system: Has other attributes At command line only attributes can change with ATTRIB command are S, H, R, and A Ch 7 8 File Attributes and the ATTRIB Command ATTRIB command: Used to manipulate file attributes Ch 7 9 File Attributes and the ATTRIB Command ATTRIB command syntax: ATTRIB [+R | -R] [+A | -A] [+S | -S] [+H | -H] [[drive:] [path] filename] [/S [/D]] Ch 7 10 File Attributes and the ATTRIB Command Attributes most useful to set and unset: R - Read-only H - Hidden Ch 7 11 File Attributes and the ATTRIB Command The A attribute (archive bit) signals file has not been backed up. Ch 7 12 File Attributes and the ATTRIB Command XCOPY command can read the archive bit.
    [Show full text]
  • HIGHLY CONFIDENTIAL Page I ~S~ O8 9 ~ ZZ CONFIDENTZAL
    Teresa Jennings From: Richard Freedman To: bradsi; davidcol; dosmktg; msdosmgr; tonya Subject: ..Companion Vision doc Date: Friday, June 11, 1993 12:46PM here it is. it is a first draft so please don’t flame too much. thanks < < File Attachment: CMPNION.DOC> > HIGHLY CONFIDENTIAL Page I ~S~ o8 9 ~ ZZ CONFIDENTZAL Plaintiff’s Exhibit I~omes V. Microsoft.~ The MS-DOS Companion for Windows Tl~e document outlines a vision for a Companion product for Windows. Situation Projectable research shows that 82% of MS-DOS 6 Upgrader purchasers use Windows. If we cons~r~tivdy assume that 85% of use~ will upgrade to Chicago and not MS-DOS 7, them the MS-DOS Upgrade will implode from being a $500 million business over the product life~lcle to an $80 million business Fur~ermor~, since MS-DOS 7 could be the end, that $80 million might eventually become $0. Big problems people have with Windows Windows obviously has strong appeal to many users. For the purposes of this document, however, Iet us ~ focus on why people have tried and rejt~ted Windows, or why dissatisfied Windows users are that way. "=" There is a large body of data that consistently points to s~veral key reasons: .4 Windows O~stem is slow "It takes forever to load both Windows and Windows apps" ’q’he disk always seems to be thrashing" The interface Is slow "With alt thos~ menus mad dialogs, it takes too many steps to get something done" 7~e Interface is ¢onfu~ng ’Tin lost - there’s too much on the screeat and too many choices" ’Tin ba2~led.
    [Show full text]
  • An A-Z Index of the Windows CMD Command Line
    An A-Z Index of the Windows CMD command line aaADDUSERSADDUSERS Add or list users to/from a CSV file ADmodcmd Active Directory Bulk Modify ARP Address Resolution Protocol ASSOC Change file extension associations• ASSOCIAT One step file association AT Schedule a command to run at a specific time ATTRIB Change file attributes bb BCDBOOT Create or repair a system partition BCDEDIT Manage Boot Configuration Data BITSADMIN Background Intelligent Transfer Service BOOTCFG Edit Windows boot settings BROWSTAT Get domain, browser and PDC info cc CACLS Change file permissions CALL Call one batch program from another• CERTREQ Request certificate from a certification authority CERTUTIL Utility for certification authority (CA) files and services CD Change Directory - move to a specific Folder• CHANGE Change Terminal Server Session properties CHKDSK Check Disk - check and repair disk problems CHKNTFS Check the NTFS file system CHOICE Accept keyboard input to a batch file CIPHER Encrypt or Decrypt files/folders CleanMgr Automated cleanup of Temp files, recycle bin CLEARMEM Clear memory leaks CLIP Copy STDIN to the Windows clipboard CLS Clear the screen• CLUSTER Windows Clustering CMD Start a new CMD shell CMDKEY Manage stored usernames/passwords COLOR Change colors of the CMD window• COMP Compare the contents of two files or sets of files COMPACT Compress files or folders on an NTFS partition COMPRESS Compress individual files on an NTFS partition CON2PRT Connect or disconnect a Printer CONVERT Convert a FAT drive to NTFS COPY Copy one or more files
    [Show full text]
  • Windows Scripting Utilities Xcopy
    Windows Scripting Utilities_xcopy Table of Contents xcopy ............................................................................................................................................... 2 xcopy Syntax -1 ............................................................................................................................... 3 xcopy Syntax -2 ............................................................................................................................... 5 xcopy Options -1 ............................................................................................................................. 6 xcopy Options -2 ............................................................................................................................. 9 xcopy Strings ................................................................................................................................. 12 xcopy Exclude ................................................................................................................................ 13 xcopy Examples -1 ......................................................................................................................... 14 xcopy Examples -2 ......................................................................................................................... 16 xcopy Exit Codes ........................................................................................................................... 21 ROBOCOPY ...................................................................................................................................
    [Show full text]
  • Basic Ms-Dos
    8/23/2017 History ■ MS-DOS 1.0 was released in August 1981, and was updated until April 1994 when it BASIC MS-DOS was replaced by Windows 95 ■ All versions of windows still contain some type of DOS, in windows 95 and 98 you can go to run and type command to get to DOS prompt, in NT, 2000, and XP you can type ~ Dharma Raj Poudel CMD and get DOS. Introduction File Manipulation The role of DOS is to interpret commands that the user enters via the keyboard. DIR - Lists files and subdirectories • Wildcard Characters ? * EDIT - creates a new file or modifies an existing file These commands allow the following tasks to be COPY - copies a file or a group of files executed: XCOPY - copies all files in a directory (and its subdirectories) file and folder management DEL or ERASE - deletes a file or a group of files UNDELETE - undeletes files disk upgrades COPY (or XCOPY) plus DEL - moves files hardware configuration DOSKEY - recalls commands memory optimization RENAME or REN - renames files TYPE - displays text files program execution PRINT - prints a text file COPY - used to create a file ATTRIB - sets file properties FC - compares two files 1 8/23/2017 Directory Manipulation Basic Structure MD or MKDIR - creates a directory ■ Most DOS commands use the same CD or CHDIR - changes directory structure PROMPT - changes the command prompt ■ Command Source Destination /Switch TREE - displays the directory structure ■ The switch will give options to the command RD or RMDIR - removes a directory ■ Example COPY A:\file.txt c:\ /v ■ /v will verify if the file copied correctly REN - Renaming directories PATH - creates a search path The Help Switch /? MS-DOS Prompt ■ You can use the help switch with any command.
    [Show full text]