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

Retreive a SAS file present in HFS and place in the FTP


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: Thu Mar 05, 2009 2:44 pm
Reply with quote

Hi,

Is there any way to retreive a file present in HFS(Hierarchical file system - area in an file system space on Z/OS) and place it in the FTP server..

Thank You..!!
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Thu Mar 05, 2009 6:14 pm
Reply with quote

FTP can GET or PUT directly to HFS file systems as long as you have the permissions to get to the directory and file. So run a mainframe FTP job to move the file to the FTP server.
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Thu Mar 05, 2009 6:38 pm
Reply with quote

I have tried in the below manner

Code:

sds.server.com
userid
pass
bin
cd 'hfs:/SYE1/tmp/'
put 'claims.txt'  data\claims.txt
quit
 


I get the error message as "Invalid local file identifier". The FTP program is unable to locate the HFS path, where as a SAS program is able to identify. I got this path when I set the FILESYSTEM options as 'HFS'.

Can you give me any ex. for reference...??
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Thu Mar 05, 2009 6:43 pm
Reply with quote

I got this path when I set the FILESYSTEM options as 'HFS' in a SAS program.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Thu Mar 05, 2009 7:28 pm
Reply with quote

Try this instead:
Code:
sds.server.com
userid
pass
bin
cd /SYE1/tmp/
put 'claims.txt'  data\claims.txt
quit
As I said, FTP understands HFS file systems -- all you have to do is enter "cd /directory/directory/file" and you'll be there.
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Thu Mar 05, 2009 7:38 pm
Reply with quote

yeah.. I have tried it..but the result is same....
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Thu Mar 05, 2009 8:12 pm
Reply with quote

Sigh ... any chance /SYE1/tmp is on your LOCAL mainframe and you're connecting to another box for the FTP? If so, change my previously provided cd /SYE1/tmp/ to lcd /SYE1/tmp/

And if that doesn't work, post some actual FTP messages with the header numbers so we can see what's going on.
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Fri Mar 06, 2009 11:26 am
Reply with quote

Thanks for your inputs....The below are the updates from my side...Now the FTP is able to identify the HFS path, but it says "There is no file with the specified name"

Code:

  libname claimst 'USERID.CLAIMS.FILE'; 
  libname hfs1 '/SYE1/tmp/';                                       
  data hfs1.AUS_CLAIMS(outrep=windows_32);               
    set claimst.AUS_CLAIMS;                           
  run;                                                             
                                                                   
  FILENAME INPUT  "USERID.FTP.TEMPIN";                           
  FILENAME OUTPUT "USERID.FTP.TEMPOUT";                           
  data _null_;                                                     
       file input;                                                 
       infile cards;                                               
       input;                                                     
       put _infile_;                                               
  cards;                                                           
CSC.FTP.COM                                         
USERID                                                     
PaSsWoRd                                                     
bin                                                           
lcd '/SYE1/tmp/'                                                   
put 'AUS_CLAIMS.sas7bdat' +                             
     Data19\AUS_CLAIMS.sas7bdat           
quit                                                               
;;;;                                                               
  run;                                                             


and the SAS log is

Code:

1            libname claimst 'USERID.CLAIMS.FILE';   
NOTE: Libref CLAIMST was successfully assigned as follows:                     
      Engine:        V9                                                         
      Physical Name: USERID.CLAIMS.FILE               
1        !                                                                     
2           
3            libname hfs1 '/SYE1/tmp/';                                     
NOTE: Libref HFS1 was successfully assigned as follows:                         
      Engine:        V9                                                         
      Physical Name: /SYE1/tmp                                                 
3        !                                                                     
4            data hfs1.AUS_CLAIMS(outrep=windows_32);                 
5              set claimst.AUS_CLAIMS;                             
6            run;                                                               
                                                                               
NOTE: Data file HFS1.AUS_CLAIMS.DATA is in a format native to another host or the file encoding does not match the
2                                                          The SAS System       
                                                                               
      session encoding. Cross Environment Data Access will be used, which may require additional CPU resources and reduce
      performance.                                                             
NOTE: There were 1300 observations read from the data set CLAIMST.AUS_CLAIMS.
NOTE: The data set HFS1.AUS_CLAIMS has 1300 observations and 55 variables.
NOTE: The DATA statement used 0.03 CPU seconds and 14677K.               

6        !                                                                     
7                                                                             
8            FILENAME INPUT  "USERID.FTP.TEMPIN";                             
9            FILENAME OUTPUT "USERID.FTP.TEMPOUT";                           
10           data _null_;                                                     
11                file input;                                                 
12                infile cards;                                               
13                input;                                                       
14                put _infile_;                                               
15           cards;                                                           
                                                                               
NOTE: The file INPUT is:                                                       
      Dsname=USERID.FTP.TEMPIN,                                               
      Unit=3390,Volume=HXB010,Disp=SHR,Blksize=27920,                         
      Lrecl=80,Recfm=FB                                                       
                                                                               
NOTE: 8 records were written to the file INPUT.                               
NOTE: The DATA statement used 0.00 CPU seconds and 14165K.                     
                                                                               
NOTE: The address space has used a maximum of 1412K below the line and 15012K a
                                                                               
                                                                               
15       !                                                                     
25         ;;;;                                                               
26           run;                                                             
27                           
28           proc ftp;  run;                                                   
NOTE: An external program, not a SAS procedure, is being executed.             
                                                                               
                                                                               
NOTE: The PROCEDURE FTP used 0.05 CPU seconds and 15569K.                     
                                                                               
NOTE: The address space has used a maximum of 2040K below the line and 16472K a
                                                                               
                                                                               
28       !                                                                     
29                                                                             
30           data _null_;                                                     
31             infile output;                                                 
32             input; list; run;                                               
                                                                               
NOTE: The infile OUTPUT is:                                                   
      Dsname=USERID.FTP.TEMPOUT,                                             
      Unit=3390,Volume=HXB021,Disp=SHR,Blksize=27840,                         
      Lrecl=160,Recfm=FB         


and the FTP log is

Code:

EZA1460I Command:                                                             
EZA1736I lcd '/SYE1/tmp/'                                                     
EZA2581I HFS directory /SYE1/tmp/ is the current working directory.           
EZA1701I >>> TYPE I                                                           
200 Type set to I.                                                             
EZA1460I Command:                                                             
EZA1736I put 'AUS_CLAIMS.sas7bdat' +                               
EZA1736I      Data19\AUS_CLAIMS.sas7bdat               
EZA2558W put fails: /SYE1/tmp/AUS_CLAIMS.sas7bdat does not exist.   
EZA1460I Command:                                                             
EZA1736I quit                                                                 
EZA1701I >>> QUIT                                                             
221                                                                                                     


As the SAS log says... HFS1.AUS_CLAIMS.DATA, I have modified the FTP card as
Code:

put 'AUS_CLAIMS.DATA' +                           
     Data19\AUS_CLAIMS.DATA     

and result is
Code:
     
put fails: /SYE1/tmp/AUS_CLAIMS.DATA does not exist


any clue...??
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Fri Mar 06, 2009 5:58 pm
Reply with quote

Try
Code:
put 'AUS_CLAIMS +                           
     Data19\AUS_CLAIMS.DATA 
The SAS code indicates the library name was AUS_CLAIMS with no extension. You might want to go into OEIS or OMVS and do an ls on /SYE1/tmp/ to see what is in the directory.
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Mon Mar 09, 2009 6:31 pm
Reply with quote

When I executed the below commands
Code:

lcd /SYE1/tmp/
ls *


I couldnt see anything in the list with name AUS_CLIAMS...

But the SAS step says, it has placed the file....

and how to go into the OEIS and OMVS... can u give me any cmds abt this...??
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Mon Mar 09, 2009 6:42 pm
Reply with quote

One way would be
Code:
//TMP      EXEC  PGM=IKJEFT01,REGION=0M,
//         DYNAMNBR=200
//SYSPROC  DD  DSN=SYS1.SBPXEXEC,DISP=SHR
//SYSTSPRT DD  SYSOUT=*
//STDOUT   DD  SYSOUT=*
//SYSTSIN  DD  *
  oshell ls -al /SYE1/tmp/
/*
//
although you may have to ask your site support group about the location of the SYS1.SBPXEXEC file; this is not required to be SYS1.SBPXEXEC.

The ls command in FTP is going to list the directory for the other side of the connection -- not your local directory.

Another thing you could try would be to FTP from your desktop to your mainframe, signing in with your user id and password, then issuing the cd /SYE1/tmp/ and ls -al commands.
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Mon Mar 09, 2009 6:46 pm
Reply with quote

But, the command " lcd /SYE1/tmp/ " says that -
"HFS directory /SYE1/tmp/ is the current working directory".

Then the command " ls " should also search in the HFS directory only rt..??
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Mon Mar 09, 2009 6:52 pm
Reply with quote

When you're doing FTP, be aware of the difference between lcd and cd -- lcd changes the directory on your local machine (i.e., the client) whereas cd changes the directory on the remote machine (i.e., the server). The ls (or its equivalent dir) command does not work on the local machine -- only the remote machine.
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Tue Mar 10, 2009 12:34 pm
Reply with quote

Hello Robert,

A million thanks.. it worked... in /SYE1/tmp/, it saved in lower case letters... thats the reason the failure of PUT cmd....
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Tue Mar 10, 2009 4:26 pm
Reply with quote

Hello Robert,

Can you let me know like will there be any space constraint in the HFS ...?? I mean is that preallocated with a predifined size...??
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Mar 10, 2009 4:59 pm
Reply with quote

Yeah, Unix is case sensitive -- so AUS_CLAIMS and aus_claims are different files. Glad to hear you got it solved.

Be aware that Unix System Services support zFS and HFS file systems -- HFS is not being upgraded in the future as IBM wants everybody to move to zFS. HFS files are allocated via JCL and if defined with a secondary can grow just like any sequential file. zFS files are VSAM linear data sets, are defined through IDCAMS, and are preformatted before use. Depending upon your operating system release, it may or may not be possible to dynamically extend their size -- I believe that feature came in version 1.9 of z/OS (but don't hold me to that -- I haven't verified it).

How to tell the difference? If you have access to OEIS on your TSO menu, you can use the File_systems tab at the top of the screen to look at the mounted file systems; if you have access the Attributes include whether the mounted file system is HFS or zFS. Otherwise you may have to talk to your systems support group to find out for sure. For example:
Code:
 .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
 BPXWP20 ISHELL          Work with Mounted File Systems
   ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
 S ³ BPXWP22A ISHELL   File System Attributes                    ³
 U ³                                                             ³
   ³ File system name:                                           ³ Row 1 of 86
 _ ³ OMVS.PROD.BOOKS.ZOS18                                       ³
 _ ³ Aggregate name:                                             ³
 _ ³ OMVS.PROD.BOOKS.ZOS18                                       ³
 _ ³ Mount point:                                                ³
 _ ³ /u/books.zos18                                              ³
 _ ³                                                More:     +  ³
 _ ³                                                             ³
 _ ³ Status . . . . . . . . : Available                          ³
 _ ³ File system type . . . : ZFS                                ³
 _ ³ Mount mode . . . . . . : R/W                                ³
 _ ³ Device number  . . . . : 20                                 ³
 _ ³ Type number  . . . . . : 1                                  ³
 _ ³ DD name  . . . . . . . :                                    ³
 _ ³ Block size . . . . . . : 1024                               ³
 _ ³ Total blocks . . . . . : 1175879                            ³
 _ ³ Available blocks . . . : 121415                             ³
 _ ³  F1=Help        F3=Exit        F4=Name        F6=Keyshelp   ³
 _ ³ F12=Cancel                                                  ³
 a ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
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 Unable to interpret a hex value to De... COBOL Programming 4
No new posts REXX/CMS How to place command console... CLIST & REXX 4
No new posts how to eliminate null indicator value... DB2 7
No new posts Format Binary file to EBCDIC JCL & VSAM 4
No new posts Binary File format getting change whi... All Other Mainframe Topics 7
Search our Forums:

Back to Top