Help using Base SAS procedures

FTP file output - one line per record

Reply
Occasional Contributor
Posts: 18

FTP file output - one line per record

I am having issues getting a file to output w/ 1 record per line

Using:
FILENAME L15FTPS FTP "rcvfile15.raw" LRECL=184
CD="**"
USER="***"
PASS="***"
HOST="*";

w/ PUT statement:
data dialerexp;
set TODIALER;
file l15ftps lrecl=184 ;
put
@1 DLDATE yymmddn8.
@9 ACCTNUM $14.
@23 CUSTNM $60.
@83 CUSTTELID $10.
@93 EXPD $10.
@103 TYPE $2.
@105 effdate $8.
@113 type1 $6.
@119 method $15.
@134 obcall $3.
@137 usaaf $3.
@140 revdate $8.
@148 reviews $5.
@153 connects $5.
@158 contacts $5.
@163 actdate yymmddn8.
@171 blkdate $8.
@179 blkyn1 $3.
@182 blkyn2 $3.;
run;

The output is continous. I need one line per record..so max line size should be 183. I have tried several file options..such as lrecl and linesize but no luck.. please help.
Trusted Advisor
Posts: 2,113

Re: FTP file output - one line per record

FTP is not a record oriented format. If you want some sort of end of line character(s), then you can code them manually.

CRLF='090A'X; <-- Windows
LF='0A'; <-- Unix

and include them in the output stream.
Occasional Contributor
Posts: 18

Re: FTP file output - one line per record

I will try that. It's just strange that I have other outputs using the same FTP method and destination server..same put statements (longer records) and each observation is on a new line on the output file.
SAS Super FREQ
Posts: 8,743

Re: FTP file output - one line per record

Hi:
According to the way that I used to count bytes in order to lay out sequential files, if BLKYN2 -starts- @182, and is 3 bytes, then it will occupy 182, 183 and 184. You said that "max line size should be 183" -- by my counting, max line size should be 184 for all the data, if BLKYN2 is actually 3 bytes.

cynthia
[pre]
Layout starting at 171:

@171 blkdate $8.
@179 blkyn1 $3.
@182 blkyn2 $3.;

11111111111111111111
77777777788888888889
.....12345678901234567890
xxxxxxxxyyyzzz
|------||-||-|
| | |
blkdate | |>blkyn2
|
blkyn1
Super User
Posts: 9,687

Re: FTP file output - one line per record

Did you try next line point operator / ?
[pre]
put
@1 DLDATE yymmddn8.
@9 ACCTNUM $14.
@23 CUSTNM $60.
@83 CUSTTELID $10.
@93 EXPD $10.
@103 TYPE $2.
@105 effdate $8.
@113 type1 $6.
@119 method $15.
@134 obcall $3.
@137 usaaf $3.
@140 revdate $8.
@148 reviews $5.
@153 connects $5.
@158 contacts $5.
@163 actdate yymmddn8.
@171 blkdate $8.
@179 blkyn1 $3.
@182 blkyn2 $3. / ;
[/pre]


Ksharp
Ask a Question
Discussion stats
  • 4 replies
  • 136 views
  • 0 likes
  • 4 in conversation