36.PROC IMPORT AND EXPORT DATASETS

                            PROC IMPORT AND EXPORT DATASETS


1.PROC IMPORT:

FILE WHICH IS IN EXTERNAL ENVIRONMENT IMPORTING INTO SAS ENVIRONMENT..

PROC IMPORT DATAFILE="C:\Users\Lenovo\Desktop\SAS - Copy (3).txt"

           OUT=WORK.A5

   REPLACE;

RUN;


LOG:

 /**********************************************************************
7     *   PRODUCT:   SAS
8     *   VERSION:   9.4
9     *   CREATOR:   External File Interface
10    *   DATE:      14SEP15
11    *   DESC:      Generated SAS Datastep Code
12    *   TEMPLATE SOURCE:  (None Specified.)
13    ***********************************************************************/
14       data WORK.A5    ;
15       %let _EFIERR_ = 0; /* set the ERROR detection macro variable */
16       infile 'C:\Users\Lenovo\Desktop\SAS - Copy (3).txt'
16 ! delimiter='09'x MISSOVER DSD lrecl=32767 firstobs=2 ;
17          informat DARSHI_22_M_KKL $14. ;
18          format DARSHI_22_M_KKL $14. ;
19       input
20                   DARSHI_22_M_KKL $
21       ;
22       if _ERROR_ then call symputx('_EFIERR_',1);  /* set ERROR detection macro variable */
23       run;

NOTE: The infile 'C:\Users\Lenovo\Desktop\SAS - Copy (3).txt' is:
      Filename=C:\Users\Lenovo\Desktop\SAS - Copy (3).txt,
      RECFM=V,LRECL=32767,File Size (bytes)=131,
      Last Modified=23 July 2023 14:55:17,
      Create Time=07 July 2023 12:14:23

NOTE: 8 records were read from the infile 'C:\Users\Lenovo\Desktop\SAS - Copy (3).txt'.
      The minimum record length was 8.
      The maximum record length was 15.
NOTE: The data set WORK.A5 has 8 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.23 seconds
      cpu time            0.04 seconds


8 rows created in WORK.A5 from C:\Users\Lenovo\Desktop\SAS - Copy(3).txt.


NOTE: WORK.A5 data set was successfully created.
NOTE: The data set WORK.A5 has 8 observations and 1 variables.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           2.67 seconds
      cpu time            0.25 seconds

RESULT:

DARSHI_22_M_KKL
RAM,25 ,M,
RAHIM,26,, KYC
HIMA,21,F,POB
RAJU,15, ,
RANGA,22,M,LLM
KALYANI,,F,DDD
JAGAN,25,,
SARU,,F,



2.PROC EXPORT:
FILE EXPORTING TO EXTERNAL ENVIRONMENT FROM SAS ENVIRONMENT..

PROC EXPORT DATA=WORK.A5
        OUTFILE="C:\Users\Lenovo\Desktop\QWER.XLS"
        DBMS=XLS
REPLACE;
RUN;

LOG:


NOTE: The export data set has 8 observations and 1 variables.
NOTE: "C:\Users\Lenovo\Desktop\QWER.XLS" file was successfully created.
NOTE: PROCEDURE EXPORT used (Total process time):
      real time           0.18 seconds
      cpu time            0.01 seconds

RESULT:






--PLEASE FOLLOW THE BLOG FOR MORE INFO....

--JOIN US IN FACEBOOK AND TELEGRAM CHANNEL FOR MORE UPDATES

   CLICK HERE: https://t.me/SasAll4You



Comments