How to insert more than one selection criteria in adapya search buffer

from adabas.datamap import *
from adabas.api import *
import pandas as pd
c1 = Adabas(rbl=256,fbl=64,sbl=32,vbl=128,ibl=0)
c1.cb.dbid = 12
c1.cb.fnr = 11
c1.cb.cid =b’1211’
c1.fb.value = ‘AA,AC,AE,AD,AF,AG,AH,6,U,AJ,AK,AL,AN,AM,AO,AP,AU,AV.’
c1.sb = ‘AF,1.’
c1.vb = ‘S’

I need to define one more filter

c1.sb = ‘AG,1.’
c1.vb = ‘M’

row=Datamap(‘rows’,
String(‘personnel_id’, 8, fn=‘AA’),
String(‘first_name’, 20, fn=‘AC’),
String(‘name’, 20, fn=‘AE’),
String(‘middle_name’, 20, fn=‘AD’),
Char(‘mar_stat’, fn=‘AF’),
Char(‘sex’, fn=‘AG’),
String(‘birth’, 6, fn=‘AH’),
String(‘city’, 20, fn=‘AJ’),
String(‘post_code’, 10, fn=‘AK’),
String(‘country’, 3, fn=‘AL’),
String(‘area_code’, 6, fn=‘AN’),
String(‘phone’, 15, fn=‘AM’),
String(‘dept’, 6, fn=‘AO’),
String(‘job_title’, 25, fn=‘AP’),
String(‘leave_due’, 2, fn=‘AU’),
String(‘leave_taken’, 2, fn=‘AV’))
row.buffer = c1.rb
row.offset = 0
dic = {‘Personnel ID’:, ‘First Name’:, ‘Name’:, ‘Sex’:, ‘Mar Status’:, ‘Job Title’:}
c1.find(saveisn=1)
while True:
try:
c1.getnext()
dic[‘Personnel ID’].append(row.personnel_id)
dic[‘First Name’].append(row.first_name)
dic[‘Name’].append(row.name)
dic[‘Mar Status’].append(row.mar_stat)
dic[‘Sex’].append(row.sex)
dic[‘Job Title’].append(row.job_title)
except DataEnd:
print(‘Data End’)
break
except DatabaseError as (error, apa):
error = error.split(’:’)[1]
print error
employees_df = pd.DataFrame(dic)
display(employees_df)

What are trying to achieve? Please describe in detail.

Do you get any error messages? Please provide a full error message screenshot and log file.

Combine your criteria with a D (logical AND) and concatenate the vb values.

c1.sb = ‘AF,1,D,AG,1.’
c1.vb = ‘SM’

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.