I get 3 flat file witout header. Using coded as follows-
MAVHIC01 has data-------
1 john calgary
2 Arvi vancouver
DaTA.BKUP_00 has data---
1 fisher Reddeer
2 Ahmadi vancouver
DaTA.BKUP_01 has data---
1 mario Ottwa
2 Julia winnipeg
FILENAME SORTA1 ('/shared/uniki//Mq.FLAT.MAVHIC01'
'/shared/uniki/Mq.CMA.DaTA.BKUP_00'
'/shared/uniki/Mq.CMA.DaTA.BKUP_01'
);
I have one .sas file which has input variables and code is as follows-
** Pos Field Name Length;
INPUT @1 id 2. /* id */
@1 name $ 6. /* employee name */
@1 city $ 20. /* working city */
Now I wonder what will be in SORTA1 and how the data will be stored in id,name,city inputs.
Maxim 4: Try it.
Run your code, inspect the resulting dataset, and study the log.
Without knowing whether the file referenced was using in an INFILE or FILE statement it is pretty hard to tell what may be going one.
If that is used for INFILE with that exact input statement I suspect you will likely not like the contents of Name or City.
Thanks for reply.
Yes, it is using INFILE as follows-
data SORTA;
INFILE SORTA1 lrecl=150 RECFM=F;
%INCLUDE '/sas//me/refr/phis.sas';
The phis.sas file has input variables.
** Pos Field Name Length;
INPUT @1 id 2. /* id */
@1 name $ 6. /* employee name */
@1 city $ 20. /* working city */
And, per @Kurt_Bremser's suggestion, did you try it? What results did you get?
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.