BookmarkSubscribeRSS Feed
Calcite | Level 5



I'm trying to write a file from UNIX (SAS 9.4) to z/OS with the file statement by ftp. The instruction are:

Filename cau ftp "'WEB.causa.xx.xx'" HOST=&host. USER=&User. pass=&pass.;
   FILE cau recfm=B RECFM=FB LRECL=80;
   SET causa_1;
            PUT @1   COD_MULTICOMPAGNIA        $3.
                @8   NUMERO_CAUSA              $20.
                @28  COD_TIPO_GIUDIZIO         $1.



It doesn't take the rigth format of the file (DCB=(RECFM=FB,LRECL=80)) and it write a variable file with lrecl=256.


On the other hand, I have a problem with another file, with the same methon I have an error:


Filename cau ftp "'" HOST=&host USER=&user pass=&pass;
   FILE cau;
   SET causa_1;
            PUT @1   COD_MULTICOMPAGNIA        $3.
                @4   PROGR_CAUSA               IB4.
                @8   NUMERO_CAUSA              $20.
                @28  COD_TIPO_GIUDIZIO         $1.
                @29  COD_TIPO_CAUSA            $3.
                @32  COD_SETTORE               $3.
                @35  COD_DETTAGLIO_SETTORE     $3.
                @38  COD_UFFICIO_GESTORE       $3.
                @41  COD_NOME_GESTORE          $30.
                @71  COD_STATO_CAUSA           $1.
                @72  SOMMARIO                  $50.
                @122 PROGRESSIVO_CHIUSURA_CAUSA IB4.
                @126 NUMERO_SCHEDA             ib4.
                @130 COD_AGENZIA               $3.
                @133 COD_SUBAGENZIA            $2.
                @135 DAT_ESER_RUBRICAZ        ib2.
                @137 COD_DANNO                 $9.
                @146 COD_NOMINATIVO            IB4.
                @150 NUM_PROGR_PARTITA         IB2.
                @152 ID_OPERATORE              $10.
                @162 ID_DATA_MANIPOLAZ         $10.
                @172 CAUSA_CONTENZ             $19.
                @191 DATA_CHIUSURA_CAUSA       $10.
                @201 COD_CAUSA_PROVEN_RISS     $24.
                @225 COASSICURAZIONE           $2.
                @227 COD_TIP_COMPARTO_DT_GGL   $4.
                @231 DAT_INS_CAUSA             $10.



The error is:


ERROR: Broken pipe.
 FATAL: Unrecoverable I/O error detected in the execution of the DATA step program.  Aborted during the EXECUTION phase.
 ERROR: File transfer abended after running out of disk space.  Validate that the required amount of data was written.  The file
        might need to be re-created with additional space.
 NOTE: The SAS System stopped processing this step because of errors.
 NOTE: There were 25274 observations read from the data set WORK.CAUSA_1.
 NOTE: DATA statement used (Total process time):
       real time           1.40 seconds
       cpu time            0.11 seconds


Cound someone help me with this two error?




Super User

The second part if fairly clear:

ERROR: Broken pipe.
 FATAL: Unrecoverable I/O error detected in the execution of the DATA step program.  Aborted during the EXECUTION phase.
 ERROR: File transfer abended after running out of disk space.  Validate that the required amount of data was written.  The file 

You ran out of disk space and the ftp connection was broken because of that. You should investigate the file size you are transferring and your permissions and limits on the receiving system. Your Z/Os admin may need to adjust available disk space assignments for the process.



For the first I would suggest posting the entire log. I think that with two RECFM options in the FILE statement that may be an issue with the result. You may want to consider setting the RECFM option on the filename as the UNIX options may not translate correctly. Some of this is guessing as I have neither Unix nor Z/Os to test with.

Calcite | Level 5



I tried the two method. In the log I have the correct indication about RECFM e LRECL, but in the host environment the type of the file created is different:


 62         Filename tpcausa ftp "'xca.migr.WEB.tipo.causa'" &conn_host. ;
 63          DATA _NULL_ ;
 64            FILE tpcausa RECFM=FB LRECL=80;
 65           SET tipo_causa_1;
 67            PUT @1 COD_TIPO_CAUSA        $3.
 68                @4 DES_TIPO_CAUSA        $30.
 69          ;
 70         run;
 NOTE: 220-TCPFTPSB IBM FTP CS V2R1 at TCPIPP2, 16:39:20 on 2017-10-03.
 NOTE: User XXX has connected to FTP server on Host xxx .
 NOTE: The file TPCAUSA is:
       Pathname= "'XXX.'" is working directory,
       Local Host Name=xxx,
       Local Host IP addr=xx,
       Service Hostname Name=xxx,
       Service IP addr=xx,Service Name=FTP,
       Service Portno=21,Lrecl=80,Recfm=Fixed
 NOTE: 12 records were written to the file TPCAUSA.
 NOTE: There were 12 observations read from the data set WORK.TIPO_CAUSA_1.
 NOTE: DATA statement used (Total process time):
       real time           0.74 seconds
       cpu time            0.02 seconds

Super User

What do you mean when you write "in the host environment the type of the file created is different"? Does that mean the file is text when you expect binary? Or Binary when you expect Text?


Or the line lengths are different? (if so, how do you determine line length on the host and the base data?)

Or are characters getting converted to/from UTF or ASCII or other encoding?


There may be some options on your FTP libname statement to set related to file contents or just plain FTP options that your host is defaulting to that you need to specify.



Time is running out to save with the early bird rate. Register by Friday, March 1 for just $695 - $100 off the standard rate.


Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 


Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 2 in conversation