Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@


title: CBXP
cbxp_version: 0.0.2
cbxp_version: 0.0.3
description: >- # this means to ignore newlines until "baseurl:"
A unified and standardized interface for extracting z/OS control block data.
permalink: /:title/
logo: "/assets/images/logo.svg"

# Build settings
remote_theme: just-the-docs/just-the-docs@v0.10.1
remote_theme: just-the-docs/just-the-docs@v0.12.0
include:
- contribute.markdown
color_scheme: dark
Expand Down Expand Up @@ -72,7 +72,7 @@ callouts:
mermaid:
# Version of mermaid library
# Pick an available version from https://cdn.jsdelivr.net/npm/mermaid/
version: "11.12.0"
version: "11.13.0"

# Exclude from processing.
# The following items will not be processed, by default.
Expand Down
4 changes: 2 additions & 2 deletions _includes/nav_footer_custom.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<footer class="site-footer">
<div class="site-footer-div">
<br>
<br>
CBXP {{ site.cbxp_version }}<br><br>
Expand All @@ -7,4 +7,4 @@
This site uses <a href="https://github.com/just-the-docs/just-the-docs">Just the Docs</a>, a documentation theme for Jekyll.
<br>
<br>
</footer>
</div>
65 changes: 42 additions & 23 deletions assets/css/just-the-docs-default.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ html, body {
color: #9af;
}

.search-input:focus {
outline: 2px solid #9af;
border-radius: inherit;
}

.search-input {
color: #fff
}
Expand Down Expand Up @@ -233,6 +238,7 @@ code, div.highlighter-rouge {
}

blockquote.note, p.note {
border: 0;
border-left: 4px solid #9af;
background-color: rgba(119, 119, 255, 0.2)
}
Expand All @@ -246,6 +252,16 @@ blockquote.note code.highlighter-rouge {
color: #ccc;
}

blockquote.warning::before {
color: #ffeb82;
}

blockquote.warning {
border: 0;
border-left: 4px #ffeb82 solid;
background-color: rgba(231, 175, 6, 0.2);
}

blockquote.warning code.highlighter-rouge {
background-color: rgb(95, 85, 50);;
color: #ccc;
Expand All @@ -256,6 +272,16 @@ blockquote.warning table code.highlighter-rouge {
color: #eee;
}

blockquote.development_status::before {
color: #f77e7e
}

blockquote.development_status {
border: 0;
border-left: 4px #f77e7e solid;
background-color: rgba(221, 46, 46, 0.2);
}

blockquote.experimental code.highlighter-rouge {
background-color: #545;
color: #ccc;
Expand Down Expand Up @@ -285,7 +311,7 @@ blockquote.warning > div.table-wrapper > table > tbody > tr > td {
background-color: rgb(95, 85, 50);
}

blockquote.warning > div.highlighter-rouge > button {
blockquote.warning > div.highlighter-rouge > button:focus {
background-color: rgb(95, 85, 50);
border-color: rgb(95, 85, 50);
}
Expand All @@ -296,7 +322,7 @@ blockquote.note > div.highlighter-rouge > div.highlight pre {
background-color: #484878;
}

blockquote.note > div.highlighter-rouge > button {
blockquote.note > div.highlighter-rouge > button:focus {
background-color: #484878;
border-color: #484878;
}
Expand Down Expand Up @@ -443,11 +469,12 @@ img {
padding-bottom: 40px;
}

.site-footer {
.site-footer-div {
text-align: center;
color: #959396;
}

.site-footer > a > img {
.site-footer-div > a > img {
width: 75%;
}

Expand Down Expand Up @@ -490,7 +517,7 @@ img {
}

@media only screen and (max-height: 549px) {
.site-footer {
.site-footer-div {
padding-top: 0;
line-height: 1;
}
Expand All @@ -517,8 +544,8 @@ img {
}

@media only screen and (max-width: 1066px) {
.main {
padding-bottom: 14rem;
.site-footer-div {
position: inherit;
}
}

Expand All @@ -529,7 +556,10 @@ img {
.site-nav > .nav-list > li:last-child {
margin-bottom: 10px;
}
.site-footer > a > img {
.site-footer-div {
margin-left: -20px;
}
.site-footer-div > a > img {
width: 50%;
}
.side-bar {
Expand Down Expand Up @@ -572,22 +602,7 @@ img {
}
}

@media only screen and (max-width: 699px) {
.main {
padding-bottom: 13rem;
}
}

@media only screen and (max-width: 599px) {
.main {
padding-bottom: 12rem;
}
}

@media only screen and (max-width: 499px) {
.main {
padding-bottom: 11rem;
}
.nav-list .nav-list-item .nav-list-expander {
height: 1.6rem;
width: 1.6rem;
Expand All @@ -606,6 +621,10 @@ img {
div.highlighter-rouge > button, div.listingblock > div.content > button, figure.highlight > button {
color: #9af;
border-radius: 5px;
}

div.highlighter-rouge > button:focus {
outline: 2px solid #9af;
background-color: #334;
border-color: #334;
}
Expand Down
173 changes: 173 additions & 0 deletions filters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
---
layout: default
nav_order: 3
---

# Filters

How to use filters to filter repeated control block data.
{: .fs-6 .fw-300 }

&nbsp;

Some control blocks like the [ASCB](https://www.ibm.com/docs/en/zos/latest?topic=iar-ascb-information) are **Repeated**. When extracting these **Repeated** control blocks, you may want to only extract the entries that match one or more **Filters**. CBXP allows **Filters** to be provided when extracting **Repeated** control block data.

## Filter Basics

&nbsp;

**Filters** are specified as key-value pairs, where the key is a **Control Block Field** and the value is a **Filter Value**.

&nbsp;

The following example extracts all [ASSB](https://www.ibm.com/docs/en/zos/latest?topic=iar-assb-information) control blocks where the **Control Block Field** `ASSBJBNI` matches the **Filter Value** `IBMUSER`.

###### Python Script
```python
from cbxp import CBXPFilter, CBXPFilterOperation, cbxp

cbdata = cbxp(
"assb",
filters=[
CBXPFilter(
"assbjbni",
CBXPFilterOperation.EQUAL,
"IBMUSER"
)
]
)
```

###### Shell Script
```shell
cbxp -f assbjbni=IBMUSER assb
```

## Using Multiple Filters

&nbsp;

Multiple **Filters** can be used.

&nbsp;

The following example extracts all [ASSB](https://www.ibm.com/docs/en/zos/latest?topic=iar-assb-information) control blocks where both the **Control Block Field** `ASSBJBNI` matches the **Filter Value** `IBMUSER` and the **Control Block Field** `ASSBJBNS` matches the **Filter Value** `BPXAS`.

###### Python Script
```python
from cbxp import CBXPFilter, CBXPFilterOperation, cbxp

cbdata = cbxp(
"assb",
filters=[
CBXPFilter(
"assbjbni",
CBXPFilterOperation.EQUAL,
"IBMUSER"
),
CBXPFilter(
"assbjbns",
CBXPFilterOperation.EQUAL,
"BPXAS"
)
]
)
```

###### Shell Script
```shell
cbxp -f assbjbni=IBMUSER -f assbjbns=BPXAS ascb
```

## Using Filters With Include Patterns

&nbsp;

**Filters** can be use with control blocks included using [Include Patterns](../include_patterns).

&nbsp;

The following example extracts all [ASCB](https://www.ibm.com/docs/en/zos/latest?topic=iar-ascb-information) and corresponding [ASSB](https://www.ibm.com/docs/en/zos/latest?topic=iar-assb-information) control blocks where the **Control Block Field** `ASSBJBNI` matches the **Filter Value** `IBMUSER`.

###### Python Script
```python
from cbxp import CBXPFilter, CBXPFilterOperation, cbxp

cbdata = cbxp(
"ascb",
includes=["assb"],
filters=[
CBXPFilter(
"assb.assbjbni",
CBXPFilterOperation.EQUAL,
"IBMUSER"
)
]
)
```

###### Shell Script
```shell
cbxp -i assb -f assb.assbjbni=IBMUSER ascb
```

## Using Filters With `fnmatch` Patterns

&nbsp;

[`fnmatch`](https://www.man7.org/linux/man-pages/man3/fnmatch.3.html) patterns can be used as **Filter Values**.

&nbsp;

The following example extracts all [ASSB](https://www.ibm.com/docs/en/zos/latest?topic=iar-assb-information) control blocks where the **Control Block Field** `ASSBJBNI` matches the **Filter Value** `IBMUSER*`.

###### Python Script
```python
from cbxp import CBXPFilter, CBXPFilterOperation, cbxp

cbdata = cbxp(
"assb",
filters=[
CBXPFilter(
"assbjbni",
CBXPFilterOperation.EQUAL,
"IBMUSER*"
)
]
)
```

###### Shell Script
```shell
cbxp -f 'assbjbni=IBMUSER*' assb
```

## Filtering Numeric Data

&nbsp;

`>`, `>=`, `<`, and `>=` can be used when filtering **Numeric Control Block Fields**.

&nbsp;

The following example extracts all [ASSB](https://www.ibm.com/docs/en/zos/latest?topic=iar-assb-information) control blocks where the **Control Block Field** `ASSB_TIME_ON_CP` is **Less Than** `30000`.

###### Python Script
```python
from cbxp import CBXPFilter, CBXPFilterOperation, cbxp

cbdata = cbxp(
"assb",
filters=[
CBXPFilter(
"assb_time_on_cp",
CBXPFilterOperation.LESS_THAN,
30000
]
)
```

###### Shell Script
```shell
cbxp -f 'assb_time_on_cp<3000' assb
```
Loading