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 is Global Symbol table and Local symbol table?

4 Answers   CitiGroup,


The below code we are using for creating more than one macro variables in proc sql using into clause. How we can use same code to create macro variables vara, varb, varc instead of var1, var2, var3.? proc sql noprint; select count(distinct(patient)) into :var1 - :var3 from dataset1 group by trtreg1c ; quit;

1 Answers   Accenture,


What is the Program Data Vector (PDV)? What are its functions?

5 Answers   Accenture,


In the SAS Data step what is the difference between the subsetting done by Where and subsetting done by If?

6 Answers   Cognizant,


Which is Best Institute for learning SAS BASE & SAS BI in Hyderabad? Can anyone suggest me ?

5 Answers   ACC,






If reading an external file to produce an external file, what is the shortcut to write that record without coding every single variable on the record?

4 Answers  


How would you define the end of a macro? : sas-macro

0 Answers  


Which statement does not perform automatic conversions in comparisons?

0 Answers  


What is SAS Information Map Studio and its purpose ?

2 Answers   SAS, TCS,


what is ae onset date n what is RDS

0 Answers   Accenture,


is there any difference between proc summary and proc means?

3 Answers  


how do you debug and test your sas programs? : Sas programming

0 Answers  


Categories