View previous topic :: View next topic |
Author |
Message |
sumanth4u Beginner
Joined: 13 Feb 2006 Posts: 1 Topics: 1 Location: bangalore
|
Posted: Thu Mar 23, 2006 4:36 am Post subject: Doubt in SAS program. |
|
|
I am reading a COBOL file and writing ot SAS file the thing is that i'm n't able to get the required output and only all ecords are reading and only one record is writing .
Please check the code below and help me in this regard.
Code: |
DATA F1;
INFILE ERRMSG;
INPUT @1 CLNT $CHAR02.
@3 CUST $CHAR07.
@10 GRP_NM $CHAR30.
@40 GRP_I_CONV $CHAR01.
@41 GRP_D_ $CHAR08.
@49 GRP_MKT $CHAR03.
@52 I_STRATEGIC_CUST $CHAR01.
@53 ALIAS_CUST $CHAR07.
@60 CUST_FIRST3_CHAR $CHAR03.
@63 C_NM_CUST $CHAR60.
@66 ERROR $CHAR03.
@69 HLP $CHAR80.
@149 KEY $CHAR20.
@169 DIV $CHAR04.;
PROC SUMMARY DATA=F1;
OUTPUT OUT=O1;
DATA _NULL_;
SET O1;
FILE REPORT;
PUT @1 RPT_CLNT $CHAR02.
@3 RPT_CUST $CHAR07.
@10 RPT_GRP_NM $CHAR30.
@40 RPT_GRP_I_CONV $CHAR01.
@41 RPT_GRP_D_EFF $CHAR08.
@49 RPT_GRP_MKT $CHAR03.
@52 RPT_I_STRATEGIC_CUST $CHAR01.
@53 RPT_ALIAS_CUST $CHAR07.
@60 RPT_CUST_FIRST3_CHAR $CHAR03.
@63 RPT_ C_NM_CUST $CHAR60.
@66 RPT_ERROR $CHAR03.
@69 RPT_HELP $CHAR80.
@149 RPT_ KEY $CHAR20.
@169 RPT_DIV $CHAR04.;
|
The requirement is easy only .but i has nill knowledge in SAS .please help me..
Thanks in advance,
Sumanth. _________________ Thanks |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Thu Mar 23, 2006 6:29 am Post subject: |
|
|
sumanth4u,
First of all you are asking for a summary which will result in just 1 row. If you want to copy the input file to output file then you need a PUT statement. Quote: |
but i has nill knowledge in SAS .please help me..
|
I can provide the code but that would not help you to learn the language, so I would suggest you start reading the online documentation of sas.
http://support.sas.com/documentation/onlinedoc/
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
jetson Beginner
Joined: 07 Oct 2005 Posts: 30 Topics: 2 Location: Texas
|
Posted: Thu Mar 23, 2006 4:30 pm Post subject: |
|
|
A PROC PRINT might be what you're looking for. BEWARE that without a limit on the records, it will attempt to print ALL records. You can limit like this:
Remove the PROC SUMMARY because you are not using it correctly.
PROC PRINT DATA=F1(OBS=100);
RUN; |
|
Back to top |
|
|
|
|