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
SAS Super FREQ
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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 839 views
  • 0 likes
  • 4 in conversation