How do you download a flat file from Mainframe to your
local PC using SAS?

Answers were Sorted based on User's Feedback



How do you download a flat file from Mainframe to your local PC using SAS?..

Answer / sastechies

I would use FileName FTP statement...

FILENAME FILE2 FTP 'PDSNAME' HOST='host'
CD= "'dir'"
user='user'
pass='pass'
lrecl=256
debug;

data _NULL_;
infile FILE2 lrecl=26095;
file "file.txt" lrecl=3000 pad;
input;
put _infile_;
run;


Any other method....

Is This Answer Correct ?    0 Yes 0 No

How do you download a flat file from Mainframe to your local PC using SAS?..

Answer / poojavaibhav

A "flat file" is a plain text or mixed text and binary file which usually contains one record per line[2] or 'physical' record (example on disc or tape). Within such a record, the single fields can be separated by delimiters, e.g. commas, or have a fixed length. In the latter case, padding may be needed to achieve this length. Extra formatting may be needed to avoid delimiter collision. There are no structural relationships between the records.


You can use Import wizard or import procedure or infile statement to create sas dataset and then use file statement to write file in log.

Is This Answer Correct ?    0 Yes 0 No

How do you download a flat file from Mainframe to your local PC using SAS?..

Answer / paul

A flat file from mainframes generally have data values assigned with the variable names.
eg: cards;
name=XXX Age=XX Gender=XXXX
name=XXX Age=XX Gender=XXXX
name=XXX Age=XX Gender=XXXX
name=XXX Age=XX Gender=XXXX
;
so to read such data into SAS we simply use named input method.
data flat;
infile 'flatfile.csv';
input var1= $ var2= var3= :ddmmyy10. var4= ;
run;
/*here i specified var1 as char, var3 with date informat
rest are numeric vars */

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SAS Interview Questions

What versions of SAS have you used (on which platforms)?

0 Answers   Quintiles,


what is TAB delimiter? explain about it? what will you do to get TAB delimiter?

3 Answers   Cap Gemini,


For a user to have access to a standard workspace server, is internal authentication alone is sufficient? : sas-grid-administration

0 Answers  


What are the applications primarily used by business analyst? : Sas-bi

0 Answers  


Explain data_null_?

0 Answers  






What is the use of the %include statement?

0 Answers  


In this question, I rename the numeric variable phone to numphone and then try use phone=put(numphone,comma16.) to store the numeric value numphone as a string value in phone. But I get a warning tha numphone already exists and in the data sat phone doesnt exist and numphone is set to missing. Why? data names_and_more; input Name $20. Phone : comma16. Height & $10. Mixed & $8.; Name = tranwrd(Name,' ',' '); rename phone = numphone; phone = put(numphone,comma16.); datalines; Roger Cody 9,087,821,234 5ft. 10in. 50 1/8 Thomas Jefferson 3,158,488,484 6ft. 1in. 23 1/2 Marco Polo 8,001,234,567 5Ft. 6in. 40 Brian Watson 5,183,551,766 5ft. 10in 89 3/4 Michael DeMarco 4,452,322,233 6ft. 76 1/3 ;

1 Answers  


How to merge the data using merge statement and proc format? Is the result is same ?

2 Answers  


Will it bother you if the guy at the next desk times the frequency and duration of your bathroom or coffee breaks on the grounds that ?you are getting paid twice as much as he is??

0 Answers   Oracle,


how to know the attributes of first five datasets in a library

2 Answers  


What is the order of evaluation of the comparison && logical && relational operators:?

2 Answers   CitiGroup,


What is auto call macro and how to create a auto call macro? What is the use of it? How to use it in sas with macros? : sas-macro

0 Answers  


Categories