Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Need to merge two files using SAS.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
abdulrafi

Active User


Joined: 14 Sep 2009
Posts: 147
Location: Coimbatore

PostPosted: Fri Nov 06, 2009 7:22 pm    Post subject: Need to merge two files using SAS.
Reply with quote

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
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Fri Nov 06, 2009 7:27 pm    Post subject: Reply to: Need to merge two files using SAS.
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2442
Location: Netherlands, Amstelveen

PostPosted: Sat Nov 07, 2009 12:33 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Sat Nov 07, 2009 6:18 pm    Post subject:
Reply with quote

The code is less than 30 lines, including checking that you don't exceed the output file size.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us