MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SAS: How to download a SAS dataset to a SDS folder

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
prasad_kdd
Beginner


Joined: 22 Aug 2005
Posts: 6
Topics: 4
Location: hyderabad

PostPosted: Thu Feb 19, 2009 12:34 am    Post subject: SAS: How to download a SAS dataset to a SDS folder Reply with quote

Hi,

Can anyone let me know the procedure for downloading the SAS dataset present in Mainframe to a SDS folder(similiar to FTP folder). On the destination side, the SAS dataset should be saved with extension "sas7bdat" i.e., MEMTYPE=DATA during downloading...I need this with this extension such that it should be readily openable using PC-SAS...

My Client uses the below code to download a SAS dataset present in Mainframe using PC-SAS as below:-

Code:

libname tmp1
'C:\Documents and Settings\Client\My Documents\dat\FOLDER_ANY';

/*--------------------------------------------------------------*/
/* SIGNON Mainframe and Download SAS Library                    */
/*--------------------------------------------------------------*/
%let host = HOST_NAME;
options remote = host;
options comamid= tcp;
filename rlink '!sasroot\connect\saslink\Client.scr';
signon;
/*--------------------------------------------------------------*/
rsubmit;
  libname dest clear;
  libname dest 'SAS dataset on Mainframe' disp=shr;
  proc download   inlib   = dest
                  outlib  = TMP1
                  memtype = data;
  run;
endrsubmit;
signoff;


When this code has been executed, the TMP1 library will contain the sas dataset downloaded in *.SAS7BDAT format. She just double clicks it to open it in Table editor(present in PC-SAS) to view the data...

Now the above process needs to be automated in Mainframe side.. So I have to do with out writing any code in PC-SAS again...which means that I should not write a code(PROC CIMPORT) to view the data....


I have tried the below code

Code:
 

LIBNAME CLAIMSF  'SAS DATASET';                 
LIBNAME CLAIMSX xport 'TRAN FILE';               

                                                         
 PROC COPY IN=CLAIMSF                                   
                   OUT=CLAIMSX                                   
                   MEMTYPE=DATA;                                 
 RUN; 
 


and receiving the following error...

Code:
 
Write access to member CLAIMSX.CLAIM_AUS.DATA is denied



PROC CONTENTS OF CLAIMSF is

Code:
 

                                 The CONTENTS Procedure                         
                                                                               
Data Set Name        CLAIMSF.CLAIM_AUS                     Observations       
Member Type          DATA                                   Variables           
Engine               V9                                     Indexes             
Created              Wed, Feb 18, 2009 02:39:17 PM          Observation Length 
Last Modified        Wed, Feb 18, 2009 02:39:17 PM          Deleted Observations
Protection                                                  Compressed         
Data Set Type                                               Reuse Space         
Label                                                       Point to Observation
Data Representation  MVS_32                                 Sorted             
Encoding             open_ed-1047  Western (OpenEdition)                       
                                                                               
                                                                               
                           Engine/Host Dependent Information                   
                                                                               
        Data Set Page Size          25600                                       
        Number of Data Set Pages    14                                         
        Number of Data Set Repairs  0                                           
        Physical Name                sas dataset
        Release Created             9.0101M3                                   
        Release Last Modified       9.0101M3                                   
        Created by                  SBCY683E                                   
        Last Modified by           SBCY683E                                   
 .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .



Then I have tried for CPORT..Below is the code..

Code:


proc cport LIBRARY=CLAIMF file=CLAIMX;
    SELECT CLAIM_AUS;                   
run;                                     
 


and transferred successfully to the FTP server with Type BINARY FORMAT and with extension .sas7bdat.

When double clicked this *.sas7bdat file, I received the error as
Code:


"ERROR: File TMP1.CLAIM_AUS.DATA is not a SAS dataset. TMP1.CLAIM_AUS cannot be opened."
 





Hope you got my problem bit clear now....

Thanks,
Prasad
_________________
prasad.Polisetti
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Feb 19, 2009 12:20 pm    Post subject: Reply with quote

prasad_kdd,


my old examples(untested)

Code:

//STEP0100 EXEC SAS                                 
//DATA1    DD DSN=YOUR MAINFRAME DATA FILE,
//            DISP=SHR                               
//TRANS    DD DSN=YOUR SAS7BAT DATASET,             
//            DISP=(NEW,CATLG,DELETE),               
//            UNIT=SYSDA,                           
//            SPACE=(CYL,(50,20),RLSE),             
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)     
//SYSIN DD *                                         
LIBNAME TRANS XPORT;                                 
PROC COPY IN=DATA1 OUT=TRANS MEMTYPE=DATA;           
RUN;                                                 
//*


Now FTP the YOUR SAS7BAT DATASET in binary mode
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group