N1 = "@02858.T.SAMPLE.ZOAU" print(f"create dataset {N1}") datasets._create(name=N1, dataset_type="SEQ", primary_space="1M", secondary_space="1M", block_size=27920, record_format="FB", record_length=80) print() print(f"write to dataset {N1}") print(datasets._write(N1, content="Hello from ZOAU1", append=False)) print(datasets._write(N1, content="Hello from ZOAU1a", append=True)) print(datasets.write(N1, content="Hello from ZOAU2", append=True)) print(datasets.write(N1, content="Hello from ZOAU2a", append=True)) print() print(f"read dataset {N1}") print(datasets._read(N1)) print(datasets.read(N1)) print() print(f"insert into dataset {N1}") datasets.lineinfile(N1, line="Hello from ZOAU0", insert_before="BOF", lock=True) datasets.lineinfile(N1, line="Hello from ZOAU3", insert_after="EOF", lock=True) datasets.lineinfile(N1, line="Hello from ZOAU4", insert_after="EOF", lock=True) datasets.lineinfile(N1, line="Hello from ZOAU5", insert_after="EOF", lock=True) RC = datasets.lineinfile(N1, line="Hello from ZOAU6", insert_after="EOF", lock=True) print(RC) print() print(f"read dataset {N1}") print(datasets.read(N1)) print() print(f"check if dataset {N1} exists") print(datasets.exists(N1)) quit() -- bash-5.2$ ./zoau13.py create dataset @02858.T.SAMPLE.ZOAU DEBUG:zoautil_py.datasets:ZOAU_CORE call: dtouch -tSEQ -s1M -e1M -B27920 -rFB -l80 @02858.T.SAMPLE.ZOAU write to dataset @02858.T.SAMPLE.ZOAU DEBUG:zoautil_py.datasets:ZOAU_CORE call: decho -- "Hello from ZOAU1" "@02858.T.SAMPLE.ZOAU" [ZOAUResponse] rc: 0 response_format: UTF-8 stdout_response: stderr_response: command: decho -- "Hello from ZOAU1" "@02858.T.SAMPLE.ZOAU" DEBUG:zoautil_py.datasets:ZOAU_CORE call: decho -a -- "Hello from ZOAU1a" "@02858.T.SAMPLE.ZOAU" [ZOAUResponse] rc: 0 response_format: UTF-8 stdout_response: stderr_response: command: decho -a -- "Hello from ZOAU1a" "@02858.T.SAMPLE.ZOAU" DEBUG:zoautil_py.datasets:write dataset function call DEBUG:zoautil_py.datasets:content: Hello from ZOAU2 DEBUG:zoautil_py.datasets:append: True DEBUG:zoautil_py.datasets:dataset: @02858.T.SAMPLE.ZOAU DEBUG:zoautil_py.datasets:kwargs: {} DEBUG:zoautil_py.datasets:ZOAU_CORE call: decho -a -- "Hello from ZOAU2" "@02858.T.SAMPLE.ZOAU" 0 DEBUG:zoautil_py.datasets:write dataset function call DEBUG:zoautil_py.datasets:content: Hello from ZOAU2a DEBUG:zoautil_py.datasets:append: True DEBUG:zoautil_py.datasets:dataset: @02858.T.SAMPLE.ZOAU DEBUG:zoautil_py.datasets:kwargs: {} DEBUG:zoautil_py.datasets:ZOAU_CORE call: decho -a -- "Hello from ZOAU2a" "@02858.T.SAMPLE.ZOAU" 0 read dataset @02858.T.SAMPLE.ZOAU DEBUG:zoautil_py.datasets:ZOAU_CORE call: dtail -n +1 -j -l "@02858.T.SAMPLE.ZOAU" [ZOAUResponse] rc: 0 response_format: UTF-8 stdout_response: {"data":{"content":"Hello from ZOAU1 \\nHello from ZOAU1a \\nHello from ZOAU2 \\nHello from ZOAU2a \\n"},"binary_mode":false,"suppress_newline":true,"program":"dtail","options":"-n +1 -j -l ","rc":"0","records":4,"content_length":332} stderr_response: command: dtail -n +1 -j -l "@02858.T.SAMPLE.ZOAU" DEBUG:zoautil_py.datasets:read dataset function call DEBUG:zoautil_py.datasets:dataset: @02858.T.SAMPLE.ZOAU DEBUG:zoautil_py.datasets:kwargs: {} DEBUG:zoautil_py.datasets:ZOAU_CORE call: dtail -n +1 -j -l "@02858.T.SAMPLE.ZOAU" Hello from ZOAU1 Hello from ZOAU1a Hello from ZOAU2 Hello from ZOAU2a insert into dataset @02858.T.SAMPLE.ZOAU DEBUG:zoautil_py.datasets:lineinfile dataset function call DEBUG:zoautil_py.datasets:dataset: @02858.T.SAMPLE.ZOAU DEBUG:zoautil_py.datasets:line: Hello from ZOAU0 DEBUG:zoautil_py.datasets:state: True DEBUG:zoautil_py.datasets:regex: None DEBUG:zoautil_py.datasets:insert_after: None DEBUG:zoautil_py.datasets:insert_before: BOF DEBUG:zoautil_py.datasets:kwargs: {'lock': True} DEBUG:zoautil_py.datasets:ZOAU_CORE call: dsed -l "1 i\Hello from ZOAU0" "@02858.T.SAMPLE.ZOAU" DEBUG:zoautil_py.datasets:lineinfile dataset function call DEBUG:zoautil_py.datasets:dataset: @02858.T.SAMPLE.ZOAU DEBUG:zoautil_py.datasets:line: Hello from ZOAU3 DEBUG:zoautil_py.datasets:state: True DEBUG:zoautil_py.datasets:regex: None DEBUG:zoautil_py.datasets:insert_after: EOF DEBUG:zoautil_py.datasets:insert_before: None DEBUG:zoautil_py.datasets:kwargs: {'lock': True} DEBUG:zoautil_py.datasets:ZOAU_CORE call: dsed -l "$ a\Hello from ZOAU3" "@02858.T.SAMPLE.ZOAU" DEBUG:zoautil_py.datasets:lineinfile dataset function call DEBUG:zoautil_py.datasets:dataset: @02858.T.SAMPLE.ZOAU DEBUG:zoautil_py.datasets:line: Hello from ZOAU4 DEBUG:zoautil_py.datasets:state: True DEBUG:zoautil_py.datasets:regex: None DEBUG:zoautil_py.datasets:insert_after: EOF DEBUG:zoautil_py.datasets:insert_before: None DEBUG:zoautil_py.datasets:kwargs: {'lock': True} DEBUG:zoautil_py.datasets:ZOAU_CORE call: dsed -l "$ a\Hello from ZOAU4" "@02858.T.SAMPLE.ZOAU" DEBUG:zoautil_py.datasets:lineinfile dataset function call DEBUG:zoautil_py.datasets:dataset: @02858.T.SAMPLE.ZOAU DEBUG:zoautil_py.datasets:line: Hello from ZOAU5 DEBUG:zoautil_py.datasets:state: True DEBUG:zoautil_py.datasets:regex: None DEBUG:zoautil_py.datasets:insert_after: EOF DEBUG:zoautil_py.datasets:insert_before: None DEBUG:zoautil_py.datasets:kwargs: {'lock': True} DEBUG:zoautil_py.datasets:ZOAU_CORE call: dsed -l "$ a\Hello from ZOAU5" "@02858.T.SAMPLE.ZOAU" DEBUG:zoautil_py.datasets:lineinfile dataset function call DEBUG:zoautil_py.datasets:dataset: @02858.T.SAMPLE.ZOAU DEBUG:zoautil_py.datasets:line: Hello from ZOAU6 DEBUG:zoautil_py.datasets:state: True DEBUG:zoautil_py.datasets:regex: None DEBUG:zoautil_py.datasets:insert_after: EOF DEBUG:zoautil_py.datasets:insert_before: None DEBUG:zoautil_py.datasets:kwargs: {'lock': True} DEBUG:zoautil_py.datasets:ZOAU_CORE call: dsed -l "$ a\Hello from ZOAU6" "@02858.T.SAMPLE.ZOAU" [ZOAUResponse] rc: 0 response_format: UTF-8 stdout_response: stderr_response: command: dsed -l "$ a\Hello from ZOAU6" "@02858.T.SAMPLE.ZOAU" read dataset @02858.T.SAMPLE.ZOAU DEBUG:zoautil_py.datasets:read dataset function call DEBUG:zoautil_py.datasets:dataset: @02858.T.SAMPLE.ZOAU DEBUG:zoautil_py.datasets:kwargs: {} DEBUG:zoautil_py.datasets:ZOAU_CORE call: dtail -n +1 -j -l "@02858.T.SAMPLE.ZOAU" Hello from ZOAU0 Hello from ZOAU1 Hello from ZOAU1a Hello from ZOAU2 Hello from ZOAU2a Hello from ZOAU3 Hello from ZOAU4 Hello from ZOAU5 Hello from ZOAU6 check if dataset @02858.T.SAMPLE.ZOAU exists DEBUG:zoautil_py.datasets:exists dataset function call DEBUG:zoautil_py.datasets:dataset: @02858.T.SAMPLE.ZOAU DEBUG:zoautil_py.datasets:ZOAU_CORE call: dls -q "@02858.T.SAMPLE.ZOAU" False