IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Tue Feb 17, 2009 11:00 am
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...

I was trying the below code

Code:

LIBNAME FTP1 SERVER='server name'                         
              USER='user-id'                                     
              PASSWORD='password';                               

PROC COPY IN=SRCNAME                                               
          OUT=FTP1                                                 
          MEMTYPE=DATA;                                             
RUN; 


and receiving the following error...

Code:

Attempt to connect to server 'server name' failed.
A communication subsystem partner link setup request failure has occurred.
Cannot locate TCP host.


But I was able to login to the same server using an FTP job... Server names was given correct...

Your help will be highly appreciable....
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Feb 17, 2009 12:46 pm
Reply with quote

Do a PROC COPY of the data and then FTP that in a seperate jobstep. Usually works.
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Tue Feb 17, 2009 1:49 pm
Reply with quote

Hello Expat,

During the PROC COPY, do we need to define the destination file with RECFM=FS or RECFM=FB...??

I dont have PC-SAS on my machine.. so I have to do with assumption... Pls help..
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Tue Feb 17, 2009 1:51 pm
Reply with quote

And also, during FTP, can we directly save in the FTP server with extension *.sas7bdat...?? If we do in that manner, will the file get opened using a PC-SAS s/w..??
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Feb 17, 2009 2:17 pm
Reply with quote

I usually run a PROC CPORT to create a portable copy
Code:

//COPYIN    DD DSN=Your SAS Library,DISP=SHR         
//COPYOUT   DD DSN=Your EXPORT File,                 
//             DISP=(,CATLG,DELETE),RECFM=FB,LRECL=80,
//             VOL=(,,,3),SPACE=(CYL,(50,50),RLSE)   
//SYSIN     DD *                                     
PROC CPORT LIBRARY=COPYIN FILE=COPYOUT;               
  SELECT   Name1 Name2 Name3;                         

Ftp the file BINARY FORMAT and then run PROC CIMPORT on the target machine to import the SAS data in perfect health.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Feb 18, 2009 4:51 am
Reply with quote

Use PROC XPORT or PROC CPORT/CIMPORT. Using the direct server connection method works only if you have SAS/ACCESS installed on both the PC and the mainframe, and then you have to do some configuration to get them connected.
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Wed Feb 18, 2009 9:12 pm
Reply with quote

Hi,

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.

When opened thru PC-SAS, I received the error as
Code:

"ERROR: File TMP1.CLAIM_AUS.DATA is not a SAS dataset. TMP1.CLAIM_AUS cannot be opened."
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Feb 19, 2009 5:36 am
Reply with quote

Did you use PROC CIMPORT on the transport file or just try to read it as a SAS file? You must use PROC CIMPORT to process the file before you can use the SAS file that was transferred.
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Thu Feb 19, 2009 9:47 am
Reply with quote

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

Hope you got my problem bit clear now....
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Feb 19, 2009 12:36 pm
Reply with quote

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

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

So why save some rather important piece of information until AFTER people have tried to help you. Do you not think that this significant piece of information may have been better offerd from the start of your thread.
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Thu Feb 19, 2009 12:43 pm
Reply with quote

Hello Expat,
In my 1st post, I have wrtten as

Quote:

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


Since the last line says that "readily openable", I thought you people might have understood that...

Past is past... Now from the latest & updated post, can anyone provide me the solution...[/b]
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Feb 19, 2009 12:44 pm
Reply with quote

Have you tried a straight FTP of the SAS dataset to the PC ?
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Thu Feb 19, 2009 12:55 pm
Reply with quote

Trasferred directly to FTP server in Binary mode, when double clicked the *.sas7bdat file, I have received

ERROR: Read Access Violation In Task ( Application Window )
Exception occurred at (5E761593)
Task Traceback
Address Frame (DBGHELP API Version 4.0 rev 5)
5E761593 04628F78 tknls:tknls+0x593
67A37A83 04629194 0001:00006A83 saswzx.dll
67A39694 046292B4 0001:00008694 saswzx.dll
67A31CDF 046292C8 0001:00000CDF saswzx.dll
67E7056F 046295C0 0001:0005F56F sashost.dll
67E7042F 0462974C 0001:0005F42F sashost.dll
67E6A546 046298E0 0001:00059546 sashost.dll
67917166 04629B64 0001:00016166 sasyh.dll
6726B548 04629D4C 0001:0000A548 sase7opn.dll
6726A82A 04629F5C 0001:0000982A sase7opn.dll
67267605 0462A1FC 0001:00006605 sase7opn.dll
67200EB7 0462A5E8 0001:0000FEB7 sasyoio.dll
671FE827 0462A728 0001:0000D827 sasyoio.dll
612AC5DA 0462AD78 0001:0000B5DA sasp01.dll
612A4FAA 0462AFD8 0001:00003FAA sasp01.dll
60E77DEE 0462B0B8 0001:00006DEE saspxq.dll
60E83856 0462B51C 0001:00012856 saspxq.dll
60E7BB40 0462B694 0001:0000AB40 saspxq.dll
66B055AD 0462BA50 0001:000045AD sasaf.dll
60E9EDDB 0462BD88 0001:0002DDDB saspxq.dll
60F0562F 0462C23C 0001:0001462F saspos.dll
60F02DCC 0462C2A8 0001:00011DCC saspos.dll
60E77DEE 0462C388 0001:00006DEE saspxq.dll
60E83856 0462C7EC 0001:00012856 saspxq.dll
60E7BB40 0462C964 0001:0000AB40 saspxq.dll
66B055AD 0462CD20 0001:000045AD sasaf.dll
60E9EDDB 0462D058 0001:0002DDDB saspxq.dll
60F0562F 0462D50C 0001:0001462F saspos.dll
60F02DCC 0462D578 0001:00011DCC saspos.dll
60E77DEE 0462D658 0001:00006DEE saspxq.dll
60E83856 0462DABC 0001:00012856 saspxq.dll
60E7BB40 0462DC34 0001:0000AB40 saspxq.dll
66A7BBE1 0462DC60 0001:0001ABE1 sasf03.dll
60EF441D 0462E47C 0001:0000341D saspos.dll
60F04906 0462E93C 0001:00013906 saspos.dll
66B3ADCB 0462EC2C 0001:00009DCB sasabld.dll
64B98037 0462ECF0 0001:00007037 sasrm.dll
64BBFDBD 0462EE14 0001:0002EDBD sasrm.dll
66A826D9 0462EE7C 0001:000216D9 sasf03.dll
66B0B05C 0462EEC8 0001:0000A05C sasaf.dll
66B13115 0462EF2C 0001:00012115 sasaf.dll
66B0680F 0462F134 0001:0000580F sasaf.dll
66A33AE2 0462FF84 0001:00002AE2 saszaf.dll
67E223EE 0462FFA0 0001:000113EE sashost.dll
67E26DE0 0462FFB4 0001:00015DE0 sashost.dll
7C80B683 0462FFEC kernel32:GetModuleFileNameA+0x1B4

WARNING: Closing data set SASUSER.DESKACT left open by program
ERROR: Read Access Violation In Task ( Application Window )
Exception occurred at (67231B8E)
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Feb 19, 2009 5:30 pm
Reply with quote

I recommend you contact SAS and open a problem report to get help. I do not know if what you're wanting to do can be done in the way you're wanting to do it. The only way to know for sure is by getting SAS Institute to help you.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
Search our Forums:

Back to Top