Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie - SAS updating files

Status
Not open for further replies.

kamur

Programmer
Mar 31, 2001
3
US
Hello,

I am very new to SAS..I have an input file (mvs), vb lrecl =8192.
I need to read each record of the file, get the unique number 8 digits starting from position 101 of the file.
I have another file, fba lrecl = 133 . This file also has a list of unique numbers at position 3 of the file (ofcourse same 8 digits).
If the unique number of file1 is present in file2, then I have to update a particular position on file1 (say position 58 needs to be changed from 'A' to 'B'). How do I go about doing this?

Greatly appreciate, if someone can provide skeleton or sample for this?

Thanks
Kamur
 
First of all I would read both of the fileS into a sas temporary sas datasets. Give the unique fields(8 digits field) same name in both files let call it "Id". Then merge both the files by Id and say if in1 and in2 then the field at position 58(letsay you named it Field1), set it to "B".

data C;
merge File1(in=in1)
File2(in=in2)
;by id;
if in1 and in2 then Field1="B";
run;

something like this
HTH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top