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

Briefly describe 5 ways to do a "table lookup" in sas.

4 Answers   Quintiles,


WHAT IS LAG FUNCTION ? WHERE CAN YOU IMPLEMENT THIS FUNCTION?

3 Answers   IBM, Zensar,


hi here is a problem can anybody solve this? i want to report the data through third party file. by using data _null_ or proc report or macro automation process. but i want to insert the 'titles and footnotes' in between the data and also starting of 2nd and ending of 2nd and starting of 3rd and ending of the 3rd page. tell me how and write the code?

0 Answers   Cognizant,


What are the joins,types of joins and thier functions?

7 Answers   SAS,


If a variable contains letters or special characters, can it be numeric data type?

0 Answers  






How would you code a merge that will keep only the observations that have matches from both sets.

5 Answers   Accenture, Bank Of America,


tell me about intnx, intcx functions?

4 Answers   CitiGroup,


How to convert .xls file into CSV format?

6 Answers   Quintiles,


What's the difference between VAR A1 - A4 and VAR A1 - A4?

1 Answers   Quintiles,


what are different analysis datasets you created and what are the new variables created

2 Answers   Sciformix,


How necessary is it to be creative in your work?

0 Answers   Oracle,


hi guys ...i have one query... data abc; input s w k g o t a m; cards; 1 2 3 4 5 6 7 8 2 3 4 5 6 7 8 9 ; run; i want the output to be the sorted order(only variables).observations should not be changed..

14 Answers  


Categories