View previous topic :: View next topic
|
Author |
Message |
abdulrafi
Active User
Joined: 14 Sep 2009 Posts: 184 Location: Coimbatore
|
|
|
|
Could anybody please help me to get a SAS prorgam for the following requirement,
I need to merge two files in SAS,
My 1st file is of LREC 10 bytes and 2nd file is of 10 bytes. The merged file is of 80 bytes.
1st file:
AAAAABBBBB
XXXXXFFFFF
2nd file:
AAAAACCCCC
AAAAADDDDD
AAAAAEEEEE
XXXXXOOOOO
My merged file should look like,
AAAAABBBBBCCCCCDDDDDEEEEE
XXXXXFFFFFOOOOO
the merged file requirement is, when the first 5 bytes in both 1st and 2nd file matches then it has to be merged and written in the merged file. If a correct match is not found it should not be written.
Kindly let me know if any clarification needed. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Abdul, you know the routine. This forum doesn't provide code. Please provide all of the details for the code you've already written, and point out where you have an issue or what specific detail you have a question about. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
The SAS Reference has a few nice MERGE examples :
SAS Reference ==> DATA Step
SAS Reference ==> Statements ==> File-handling ==> MERGE
Common Programming Tasks ==> Combining Data
SAS Reference ==> Statements ==> File-handling ==> MERGE ==> with BY |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
The code is less than 30 lines, including checking that you don't exceed the output file size. |
|
Back to top |
|
|
|