DATA Step, Macro, Functions and more

Loop query

Reply
Occasional Contributor
Posts: 13

Loop query

 We have a data set wih Account no, customer id, Total Principal Loss, Total Interest Loss , Credit amount available - total custid wise. for example One customer id will have multiple Loan accounts. We have to adjust the credit amount available to each loan account towards principal loss first & then towards interest loss. 

 

 

Super User
Posts: 19,877

Re: Loop query

[ Edited ]

Please post sample data, what you have and what you want. PLEASE no images. Include it as text or preferably a data step that we can read directly into SAS. 

 

Edit: Here's a link on how to provide data

 

https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...

Occasional Contributor
Posts: 13

Re: Loop query

Sample data set ;

Loan NoRelationship IdPrincipal lossInterest LossAvailable Amount
001a112503006000
002a1200  
003a1450  
456a22000450 
789a23000390 
786a350008504500
456a412006503000
253a41300753 
243a41900253 
     

 For each loan account we  have to adjust the pricipal loss amount first & then Interest Loss from the available amount . Logic is for one relationship id there may many loan account nos as well as savings account nos. we have taken the available amount from the savings a/c. now we have to adjust the principal loss & interest loss for each loan account  and to  updated the balance due.

 

Regards

Aarthi

Ask a Question
Discussion stats
  • 2 replies
  • 161 views
  • 0 likes
  • 2 in conversation