SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

how to read a blank space as value while reading from fixed width file

Reply
Occasional Contributor
Posts: 10

how to read a blank space as value while reading from fixed width file

my infile statement is as:
data work.etls_WGO6ITXY / view = work.etls_WGO6ITXY ;
            infile "&file_name"
                  lrecl = 32760
                  missover
                  firstobs = 1
                  ;;
            attrib N_NUM_TIPO_RECORD length = $1
              format = $1.;
            attrib N_NUM_PROTOCOLLO_DOM length = $9
              format = $9.;
            attrib N_NUM_DISTRETTO_TEL length = $3
              format = $3.;
            attrib N_NUM_NUMERO_TEL length = $8
              format = $8.;
            attrib V_COD_ABI length = $5
              format = $5.;
            attrib C_FLG_TIP_ABI length = $1
              format = $1.;
            attrib V_DES_BANCA length = $30
              format = $30.;
            attrib D_DAT_RIFERIMENTO length = $6
              format = $6.;
            attrib C_FLG_STATO_DELEGA length = $1
              format = $1.;
            attrib ID_MANDATO length = $35
              format = $35.;
            attrib V_COD_RIEMPIMENTO length = $1
              format = $1.;

          

            input @ 1 N_NUM_TIPO_RECORD  $1.
                  @ 2 N_NUM_PROTOCOLLO_DOM  $9.
                  @ 11 N_NUM_DISTRETTO_TEL  $3.
                  @ 14 N_NUM_NUMERO_TEL  $8.
                  @ 22 V_COD_ABI  $5.
                  @ 27 C_FLG_TIP_ABI  $1.
                  @ 28 V_DES_BANCA  $30.
                  @ 58 D_DAT_RIFERIMENTO  $6.
                  @ 64 C_FLG_STATO_DELEGA  $1.
                  @ 65 ID_MANDATO  $35.
                  @ 100 V_COD_RIEMPIMENTO  $1.;

          

        run;
Super User
Posts: 7,808

Re: how to read a blank space as value while reading from fixed width file

And?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Super User
Posts: 7,050

Re: how to read a blank space as value while reading from fixed width file

So the code you posted will "read a blank space as value".

What do it want it to do differently?

Ask a Question
Discussion stats
  • 2 replies
  • 246 views
  • 0 likes
  • 3 in conversation