Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Application scenarios for bs2fs file systems

&pagelevel(4)&pagelevel

Various application options for bs2fs file systems are presented in this section.

Example 1: Searching CONSLOG files

The stored CONSLOG files for the month of June 2007 are to be searched for particular contents. This search can be executed very simply using the grep command if the files are available in a bs2fs file system.

This example requires that the bs2fs container must already have been created.

Proceed as follows:

Mount the BS2000 files which are to be processed:
# mount -F bs2fs ':V70a:$sysaudit.sys.conslog.2007-06*' /home/bs2.conslog
Check the result of the mount operation:
# mount | grep 'bs2.conslog'
/home/bs2.conslog on :V70A:$SYSAUDIT.SYS.CONSLOG.2007-06* ftyp=text/nosuid on Tue Nov 27 13:52:23 2007

or

# df -k -F bs2fs | grep 'bs2.conslog'
:V70A:$SYSAUDIT.SYS.CONSLOG.2007-06*  2000000   331518  1668482    17% /home/bs2.conslog
Display the BS2000 files made available in the bs2fs file system:
# ls -l /home/bs2.conslog
Total 11836
-r-x------   1 100      OTHER     151552 Jun 12 12:32 sys.conslog.2007-06-11.007.001
-r-x------   1 100      OTHER     256000 Jun 13 13:17 sys.conslog.2007-06-12.007.001
-r-x------   1 100      OTHER      75776 Jun 13 16:26 sys.conslog.2007-06-13.007.001
-r-x------   1 100      OTHER      73728 Jun 13 17:25 sys.conslog.2007-06-13.007.002
-r-x------   1 100      OTHER      77824 Jun 14 12:36 sys.conslog.2007-06-13.007.003
-r-x------   1 100      OTHER      77824 Jun 14 14:42 sys.conslog.2007-06-14.007.001
-r-x------   1 100      OTHER    5347328 Nov 14 11:12 sys.conslog.2007-06-14.007.002
#
In the files provided, search for file names with the prefix :V70A:$BACH.SEM:
# grep ':V70A:$BACH.SEM' /home/bs2.conslog/*
...
/home/bs2.conslog/sys.conslog.2007-06-14.007.002:  <C %0MBW-000.163259  %  POS1020 Message of the POSIX kernel:WARNING: bs2_subr.c: couldbebs2fsname <:V70A:$BACH.SEM*.C>
/home/bs2.conslog/sys.conslog.2007-06-14.007.002:  <C %0MB0-000.163310  %  POS1020 Message of the POSIX kernel:WARNING: bs2_subr.c: analyseresource after toupper <:V70A:$BACH.SEM*.C>
/home/bs2.conslog/sys.conslog.2007-06-14.007.002:  <C %0MB0-000.163310  %  POS1020 Message of the POSIX kernel:WARNING: bs2_subr.c: couldbebs2fsname <:V70A:$BACH.SEM*.C>
/home/bs2.conslog/sys.conslog.2007-06-14.007.002:  <C %0MCH-000.170925  %  POS1020 Message of the POSIX kernel:WARNING: bs2_subr.c: analyseresource after toupper <:V70A:$BACH.SEM*.C>
/home/bs2.conslog/sys.conslog.2007-06-14.007.002:  <C %0MCH-000.170925  %  POS1020 Message of the POSIX kernel:WARNING: bs2_subr.c: couldbebs2fsname <:V70A:$BACH.SEM*.C>
/home/bs2.conslog/sys.conslog.2007-06-14.007.002:  <C %0MCL-000.170939  %  POS1020 Message of the POSIX kernel:WARNING: bs2_subr.c: analyseresource after toupper <:V70A:$BACH.SEM*.C>
/home/bs2.conslog/sys.conslog.2007-06-14.007.002:  <C %0MCL-000.170939  %  POS1020 Message of the POSIX kernel:WARNING: bs2_subr.c: couldbebs2fsname <:V70A:$BACH.SEM*.C>
/home/bs2.conslog/sys.conslog.2007-06-14.007.002:  <C %0MER-000.144635  %  POS1020 Message of the POSIX kernel:WARNING: bs2_subr.c: analyseresource after toupper <:V70A:$BACH.SEM*.C>
/home/bs2.conslog/sys.conslog.2007-06-14.007.002:  <C %0MER-000.144635  %  POS1020 Message of the POSIX kernel:WARNING: bs2_subr.c: couldbebs2fsname <:V70A:$BACH.SEM*.C>
/home/bs2.conslog/sys.conslog.2007-06-14.007.002:  <C %0ME1-000.165231  %  POS1020 Message of the POSIX kernel:WARNING: bs2_subr.c: analyseresource after toupper <:V70A:$BACH.SEM*.C>
/home/bs2.conslog/sys.conslog.2007-06-14.007.002:  <C %0ME1-000.165231  %  POS1020 Message of the POSIX kernel:WARNING: bs2_subr.c: couldbebs2fsname <:V70A:$BACH.SEM*.C>
/home/bs2.conslog/sys.conslog.2007-06-14.007.002:  <C %0MKI-000.133902  %  POS1020 Message of the POSIX kernel:WARNING: bs2_subr.c: analyseresource after toupper <:V70A:$BACH.SEM*.C>
/home/bs2.conslog/sys.conslog.2007-06-14.007.002:  <C %0MKI-000.133902  %  POS1020 Message of the POSIX kernel:WARNING: bs2_subr.c: couldbebs2fsname <:V70A:$BACH.SEM*.C>
/home/bs2.conslog/sys.conslog.2007-06-14.007.002:  <C %0MNC-000.130039  %  POS1020 Message of the POSIX kernel:WARNING: bs2_subr.c: analyseresource after toupper <:V70A:$BACH.SEM*.C>
/home/bs2.conslog/sys.conslog.2007-06-14.007.002:  <C %0MNC-000.130039  %  POS1020 Message of the POSIX kernel:WARNING: bs2_subr.c: couldbebs2fsname <:V70A:$BACH.SEM*.C>
#

Example 2: Converting lowercase notation to uppercase notation

The lowercase notation in a BS2000 file is to be converted to uppercase notation. You can use the tr command for this conversion if the files are contained in a bs2fs file system.

In this example it is assumed that the file to be edited is made available under
/home/bs2.conslog, as in "Example 1: Searching CONSLOG files".

Display the BS2000 files provided in the bs2fs file system:
# ls -l /home/bs2.conslog
Total 11836
-r-x------   1 100      OTHER     151552 Jun 12 12:32 sys.conslog.2007-06-11.007.001
-r-x------   1 100      OTHER     256000 Jun 13 13:17 sys.conslog.2007-06-12.007.001
-r-x------   1 100      OTHER      75776 Jun 13 16:26 sys.conslog.2007-06-13.007.001
-r-x------   1 100      OTHER      73728 Jun 13 17:25 sys.conslog.2007-06-13.007.002
-r-x------   1 100      OTHER      77824 Jun 14 12:36 sys.conslog.2007-06-13.007.003
-r-x------   1 100      OTHER      77824 Jun 14 14:42 sys.conslog.2007-06-14.007.001
-r-x------   1 100      OTHER    5347328 Nov 14 11:12 sys.conslog.2007-06-14.007.002
#
Convert the lowercase notation in the sys.conslog.2007-06-13.007.001 file to uppercase notation:

Write the result to the conslog.out file. (The name of the input file is specified unambiguously in abbreviated form using wildcards.)

# tr '[:lower:]' '[:upper:]' </home/bs2.conslog/*13.007.001 >conslog.out
Check the result by displaying the last records of the input and output files:
# tail  /home/bs2.conslog/*13.007.001
  <C %0CYT-000.162451  %  POS1020 Message of the POSIX kernel:WARNING: vfs.c: generic mount 1
  <C %0CYT-000.162451  %  POS1020 Message of the POSIX kernel:WARNING: vfs.c: generic mount 2
  <C %0CYT-000.162451  %  POS1020 Message of the POSIX kernel:WARNING: vfs.c: generic mount 3
  <C %0CYT-000.162451  %  POS1020 Message of the POSIX kernel:WARNING: bs2_vfsops.c: entering bs2fs_mount
  <C %0CYT-000.162451  %  POS1020 Message of the POSIX kernel:WARNING: bs2_subr.c: couldbebs2fsname
  <0 %0CYT-000.162451  %  EXC0420 /LOGOFF PROCESSED. CPU TIME USED: 2.8544 SEC, USER ID: TSOS, TASK ID: 1DDF00D6
  <0 %0CYU-000.162528  %  JMS0154 'TSOS' LOGGED ON FOR 'MCP0212C/STATION9'. JOB NAME 'BACHMANN'. CALLER 'TSN 0BEP'. TID 1C7E0082
  <0 %0CYU-000.162529  %  EXC0420 /LOGOFF PROCESSED. CPU TIME USED: 0.3710 SEC, USER ID: TSOS, TASK ID: 1C7E0082
     /0B1Q-000.162609 CHANGE-CONSLOG PROCESSOR NAME: MCP0212C STATION NAME: STATIO10 AUDIT-ID: 00000000000000000000000000000000
     TCLOG    .162609  ***2007-06-13*** 000004 **** UTC+02:00 ****************************************************************
# tail conslog.out
  <C %0CYT-000.162451  %  POS1020 MESSAGE OF THE POSIX KERNEL:WARNING: VFS.C: GENERIC MOUNT 1
  <C %0CYT-000.162451  %  POS1020 MESSAGE OF THE POSIX KERNEL:WARNING: VFS.C: GENERIC MOUNT 2
  <C %0CYT-000.162451  %  POS1020 MESSAGE OF THE POSIX KERNEL:WARNING: VFS.C: GENERIC MOUNT 3
  <C %0CYT-000.162451  %  POS1020 MESSAGE OF THE POSIX KERNEL:WARNING: BS2_VFSOPS.C: ENTERING BS2FS_MOUNT
  <C %0CYT-000.162451  %  POS1020 MESSAGE OF THE POSIX KERNEL:WARNING: BS2_SUBR.C: COULDBEBS2FSNAME
  <0 %0CYT-000.162451  %  EXC0420 /LOGOFF PROCESSED. CPU TIME USED: 2.8544 SEC, USER ID: TSOS, TASK ID: 1DDF00D6
  <0 %0CYU-000.162528  %  JMS0154 'TSOS' LOGGED ON FOR 'MCP0212C/STATION9'. JOB NAME 'BACHMANN'. CALLER 'TSN 0BEP'. TID 1C7E0082
  <0 %0CYU-000.162529  %  EXC0420 /LOGOFF PROCESSED. CPU TIME USED: 0.3710 SEC, USER ID: TSOS, TASK ID: 1C7E0082
     /0B1Q-000.162609 CHANGE-CONSLOG PROCESSOR NAME: MCP0212C STATION NAME: STATIO10 AUDIT-ID: 00000000000000000000000000000000
     TCLOG    .162609  ***2007-06-13*** 000004 **** UTC+02:00 ****************************************************************
#