BookmarkSubscribeRSS Feed
redfishJAX
Calcite | Level 5
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.
4 REPLIES 4
Doc_Duke
Rhodochrosite | Level 12
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.
redfishJAX
Calcite | Level 5
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.
Cynthia_sas
Diamond | Level 26
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
Ksharp
Super User
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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 4 replies
  • 1594 views
  • 0 likes
  • 4 in conversation