BookmarkSubscribeRSS Feed
Mariangela
Calcite | Level 5

HI,

 

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.;
 DATA _NULL_ ;
   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.

;run;

 

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 "WEB.causa.xxx.yyy'" HOST=&host USER=&user pass=&pass;
 DATA _NULL_ ;
   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.

;run;

 

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?

 

Thanks,

Mariangela

3 REPLIES 3
ballardw
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.

Mariangela
Calcite | Level 5

Hi,

 

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:

 

OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 61        
 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;
 66        
 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:
       Filename='xca.migr.WEB.tipo.causa',
       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
      
 
 71        
 72         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 85        

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

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1290 views
  • 0 likes
  • 2 in conversation