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

if i having variables named a b c d e f ,how to find total of each variable ????give syntax...??

6 Answers   Accenture,


Can anyone help me about SAS Realtime scenarios in Clinical field

0 Answers  


How do you debug and test your SAS programs? What can you learn from the SAS log when debugging? How do you test for missing values? How would you create multiple observations from a single observation? What are some good SAS programming practices for processing very large data sets? Briefly describe 5 ways to do a "table lookup" in SAS. Why is SAS considered self-documenting? Are you sensitive to code walk-throughs, peer review, or QC review? What other SAS features do you use for error trapping and data validation? How does SAS handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, PROCs?

2 Answers  


how do you validate tables abd reports?

2 Answers   Accenture, Quintiles,


How might you use MOD and INT on numeric to mimic SUBSTR on character Strings?

0 Answers  






This entry was posted in General. Bookmark the permalink. Post a comment or leave

0 Answers   Quintiles,


How do i read multiple spaces in datasets?

4 Answers   Quintiles,


how do you want missing values handled? : Sas programming

0 Answers  


you have a data set like this. data qqq; input name $ total; cards; qq 22 ww 33 qq 22 ee 44 rr 33 ww 44 ; run; and you want output like this......... name total qq 22 ww 44 Do it by data set step.

6 Answers  


what are some differences between proc summary and proc means? : Sas programming

0 Answers  


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

5 Answers   ACC,


DATA ABC; INPUT TDATE DATE9. AVG; CARDS; 18APR2008 150.00 19APR2008 167.00 20APR2008 123.00 21APR2008 145.00 ; RUN HOW CAN I FIND THE DIFFERENCE BETWEEN AVG OF 18APR2008 ANF 21APR2008?? IF ANY ONE GETS IT PLS TRY TO POST IT.

8 Answers   Verinon Technology Solutions,


Categories