DATA Step, Macro, Functions and more

Importing a pipe delimited file. The pipes are in the output

Accepted Solution Solved
Reply
Valued Guide
Posts: 858
Accepted Solution

Importing a pipe delimited file. The pipes are in the output

[ Edited ]

I am manipulating code I get from using the Enterprise Import feature.  The original code is this:

 

    INFILE '/sas/saswork/SAS_work39CA0000252B_scsmt300a/#LN00017'
        LRECL=467
        ENCODING="LATIN1"
        TERMSTR=CRLF
        DLM='7F'x
        MISSOVER
        DSD ;
    INPUT
        sys              : $CHAR6.
        LOAN_NUMBER      : ?? BEST20.
        LOAN_CLOSING_DATE : ?? YYMMDD8.
        FIRST_PAYMENT_DATE : ?? YYMMDD8.

 

I changed the code to allow for the maximum lengths that the Federal Reserve may provide, I also changed the date to character format.  Here is what I have:

 

INFILE "/sas/user_data/general/sandbox/pp78499/&filename"
        firstobs=2
        LRECL=542
/*        ENCODING="LATIN1"*/
/*        TERMSTR=crlf*/
        DLM='|'
        MISSOVER
        DSD ;
    INPUT

        sys              $CHAR6.
        LOAN_NUMBER      $char33.
        LOAN_CLOSING_DATE $char10.
        FIRST_PAYMENT_DATE $char10.

 

an example of the output is below:

 

ACLShe    |0000000000000000|20040716|200408    15|PA|1908    2|15000|15
ACLShe    |0000000000000000|19990604|199907    10|PA|1932    0|176663|1
ACLShe    |0000000000000000|20010213|200104    05|PA|1913    6|40000|40
ACLShe    |0000000000000000|20010215|200103    20|PA|1903    8|104000|1

 

The pipes are coming into the output, not deliminating the data.  Any help will be appreciated.

 

Thank You,

 

Mark

 

 

 

 


Accepted Solutions
Solution
‎06-23-2016 03:44 PM
Respected Advisor
Posts: 3,777

Re: Importing a pipe delimited file. The pipes are in the output

You need format modifier : colon in the input statement as in the example.

View solution in original post


All Replies
Solution
‎06-23-2016 03:44 PM
Respected Advisor
Posts: 3,777

Re: Importing a pipe delimited file. The pipes are in the output

You need format modifier : colon in the input statement as in the example.

Valued Guide
Posts: 858

Re: Importing a pipe delimited file. The pipes are in the output

Ah, if it was a snake it would have bit me.  Thanks!

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 207 views
  • 0 likes
  • 2 in conversation