Total Supra DML
Total Supra DML
Total Supra DML
DML commands used in the TOTAL/SUPRA file operations can be broadly classified into the following
categories:
These DML commands can be applied on both the master and variable files.
The syntax, parameters to be passed and error handling are some of the concepts dealt here.
SYNTAX:
The parameters dmlcommand,status and end are all mandatory for all the catogeries of the DML command.
The following table will list the parameters required for each DML commands in their respective catogery.
C C S F R L C R A Q A D D D T O E
O A T I E I O E R U C A A B A P N
M T A L F N N A G A C T T M S T D
M O T E E K T L U L E A A O K I
A G U R P R M M I S L A D O
N E S A O E F S I R N
D R T L N I S E S
Y H K T E T A
E R
Y
SINON I X X X X X X
SINOF I X X X
OPENX I X X X
CLOSX I X X X
ADD-M A X X X X X X
ADDVA A X X X X X X X X
ADDVB A X X X X X X X X
ADDVC A X X X X X X X X
ADDVR U X X X X X X X X
WRITM U X X X X X X
WRITV U X X X X X X X X
DEL-M D X X X X
DELVD D X X X X X X X X
READD R X X X X X X X X
READM R X X X X X X
READR R X X X X X X X X
READV R X X X X X X X X
RDNXT R X X X X X X
FINDX R X X X X X X X
The following table gives the details of the DML command usage in all the catogeries.
In SOTS the standard practise followed is to declare working storage variables for the dml-commands.
They look like the following :
10 TOTAL-DATA
05 SINON PIC X(5) VALUE ‘SINON’.
05 SINOF PIC X(5) VALUE ‘SINOF’.
05 OPENX PIC X(5) VALUE ‘OPENX’.
05 CLOSX PIC X(5) VALUE ‘CLOSX’.
05 ENDP PIC X(5) VALUE ‘END.’
05 RLSE PIC X(5) VALUE ‘RLSE’.
For Online:
For Batch:
CALL ‘DATBAS’ USING SINON STAT RDONLY GENNAME WK-JOBNAME OPTIONS ENDP.
Parameter descriptions :
STAT:
Here STAT is the working strorage variable which contains the error code for the DML manipulation.
It is a PIC X(4) field.
If the value of STAT is ‘****’ it means DML-OPERATION is succesful.
The programmer should handle the errors thrown by the DML logically.
ACCESS:
Only for batch – defines the type of commands to be supported by the program.
Values:
DBMOD:
Only for Batch – defines the field containing the name of the Database Description Module.
This DBMOD is generated when the DDL program is executed.
The name is of 8 characters in length.
In SOTS this value is passed thru’ the Linkage section and contains the value DUMMYGEN.
TASK:
Batch – Defines the field containing the name of the task.Eight characters in length.
It is done by either calling LLJOBNAM or XMJOBNAM using the WK-JOBNAME before the SINON is
issued.
Online – Task is defined in the TOTAL TASK Table for multi task processing.
OPTIONS:
Batch – Defines the field containing the desired logging options to be supported by single-task TOTAL.
FORMAT :
value N indicates no logging is required for this program and during this run.
For the remaining options kindly refer the TOTAL Application Programming Reference Manual.
Refer to the TOTAL Messages and Codes Reference Manual for explanations,causes and corrective
actions.
**************************************************************************************
For online –
For batch –
TASK:
Error Codes:
The OPENX command initializes one or more files for read-only or update mode.
In SOTS the online modules need not issue any OPENX commands since all the files are avaliable for the
modules and any task can be performed on them.
CALL 'DATBAS' USING OPENX STAT REALM ENDP.
REALM:
This parameter is used to mention the list of all the files to be opened in the mode.
Format:
REALM = { ALL./filemodestatEND.}
or
REALM = {entry1[,]entry2[,]……..entryn[,]END.}
In the first format if ALL. is used then all the TOTAL files will be opened in the mode that is specified.
If a file name is used then that particular file will be opened in the specified mode.
If multiple files need to opened then the OPENX DML has to be performed that many number of times.
Refer prog OM60ATOM,OM60PR50 for this type of format.
The second format can be used to open multiple files in the mode that is mentioned using the OPENX
statement.
Refer prog OM60PH50,OM60PN50 for this type of format.
Modes of OPENX:
Specifies the type of processing to be performed:
READ – The files opened in this mode can have only read operations performed on them.The files are not
locked and cannot be updated.
IUPD – The file cannot be updated by all the tasks and may or may not be locked depending on the
program.
SUPD – The file is shared for updation.The file is locked and may be updated by all the tasks using the
same copy of the TOTAL.
EUPD – The file is to be exclusively updated by this task.The file may be read but cannot be updated by
any other task.
Stat:
If a file name has been specified for this entry then TOTAL will return the status code here for the
operation on that particular file.
If ALL. option is given then the field will not be set.Only the command STAT will have the return code for
the overall operation.
Error Codes:
****, EUPD, FATL, FNAV, FUNC, FNTF, ICOR, IOER, IPAR, ISIZ, LOCK, NACT, NOTO, READ,
RSRV, SHRE, XERR.
The return codes FNTF and ISIZ will not appear in the REALM stat.
**************************************************************************************
The parameters are similar to the OPENX except for the mode of the REALM parameter.
Modes of CLOSX :
PART – No operating system close is to be used. The file is unlocked if necessary and the mode is set to
IUPD mode.Any task may read the file, but no task will be able to update it.
COMP - The operating system close is to be used. The file is unlocked if neccesary as indicated by the
current status.The file mode is reset to null.No task may be able to access the file except to open it.
****, EUPD,FATL, FUNC, FNTF, ICOR, IPAR, ISIZ, NACT, NOTO, XERR.
**************************************************************************************
Addition Category:
In the above example a record is being added to the master file ORDM.
File:
The file contains the name of the master file to which the record is to be added.
Control-Key:
The control key contains the record key of the master record to be processed.
This must be included in the data-list and the data-area parameters.
Here the control key is ORDM-ORD-NO.
Data-list:
The data-list defines the variable field which contains the list of element names.
Here ORDM-LIST is the data-list.This can be copied from the OM60.MODULES.COBOL into the
working storage section.The segements that need to be stored alone are included and others are ignored.
Control Key is a mandatory field in the data-list for ADD-M DML.
Data-area:
The data-area defines the area of the memory to be used as an I/O area for the data elements.
Here in this example ORDM-IOAREA is used as the data area .Only the variables corrseponding to the
segment in the data list defined earlier are to be copied.
**************************************************************************************
ADDVA: Parameters (ADDVA, status, file, refer, linkpath, control-key, data-list, data-area, end.)
REFER:
The refer field will contain the internal reference point of the record after which your record is to be added.
If the field has value LKxx the record will be added at the end of all the linkpaths.
If the field has value rrrr then the record will be added after the record in that particular reference position.
After the succesful addition the refer will contain the IRP(Internal Reference Point) of the record added.
LINKPATH:
****, *BCR, CSIZ, ESIZ, FATL, FNOP, FTYP, FULL, FUNC, ICHN, ICOR, IPAR, IRLC, ISIZ, IVDL,
IVEL, IVRC, LOCK, MFNF, MLNF, MRNF, NACT, NMLK, NOIO, NOTO, NSMR, SNTF, UCTL,
VFNF, VLNF, XERR.
**************************************************************************************
ADDVB: Parameter ( ADDVB, status, file, refer, linkpath, control-key, data-list, data-area, end.)
REFER:
The refer field will contain the internal reference point of the record before which your record is to be
added.
If the field has value LKxx the record will be added at the beginning of this linkpath and at the end of all
the linkpaths.
If the field has value rrrr then the record will be added before the record in that particular reference
position.
After the succesful addition the refer will contain the IRP of the record added.
****, *BCR, CSIZ, ESIZ, FATL, FNOP, FTYP, FULL, FUNC, ICHN, ICOR, IPAR, IRLC, ISIZ, IVDL,
IVEL, IVRC, LOCK, MFNF, MLNF, MRNF, NACT, NMLK, NOIO, NOTO, NSMR, SNTF, UCTL,
VFNF, VLNF, XERR.
**************************************************************************************
ADDVC: Parameters ( ADDVC, status, file, refer, linkpath, control-key, data-list, data-area, end.)
In the above statement the a record has been added to the variable file REJV
All the parameters are the same except the value in the refer field is ignored before the execution of the
command.After the execution the IRP of the record added is returned to this field.
****, *BCR, CSIZ, ESIZ, FATL, FNOP, FTYP, FULL, FUNC, ICHN, ICOR, IPAR, IRLC, ISIZ, IVDL,
IVEL, IVRC, LOCK, MFNF, MLNF, MRNF, NACT, NMLK, NOIO, NOTO, NSMR, SNTF, UCTL,
VFNF, VLNF, XERR.
**************************************************************************************
Updation Category:
ADDVR: Parameters ( ADDVC, status, file, refer, linkpath, control-key, data-list, data-area, end.)
The ADDVR command logially relinks an existing variable records without physically removing the
record.TOTAL examines every control-key defined for the record by comparing the new data area to the
TOTAL’s IO area.If a control key has changed, TOTAL unlinks the record from the old chain and logically
adds the record to the end of the new chain controlled by the key in the dataarea.If the control key has not
changed the TOTAL does not disturb the linkage.Logically the ADDVR is a combiantion of DELVD
followed by the ADDVC command.
An example :
REFER:
Do not use LKxx in the refer field.Must contain the IRP of the record to be retrieved.
****, *BCR, CSIZ, ESIZ, FATL, FNOP, FTYP, FULL, FUNC, ICHN, ICOR, IPAR, IRLC, ISIZ, IVDL,
IVEL, IVRC, LOCK, MFNF, MLNF, MRNF, NACT, NMLK, NOIO, NOTO, NSMR, SNTF, UCTL,
VFNF, VLNF, XERR.
**************************************************************************************
Parameters:
Control-Key:
The control-key should not be changed.
Programming considerations:
The record is to be read first then only the command can be executed.
The record must be explicitly held by the read statement at the time of the execution in the online modules.
****, BCTL, CSIZ, ESIZ, FNOP, FTYP, FUNC, HELD, ICOR, IPAR, IRLC, ISIZ, IVDL, LOCK, MFNF,
NACT, NHLD, MOIO, NOTO, REPC, SNTF, UCTL, XERR.
**************************************************************************************
WRITV: Parameters ( WRITV, status, file, refer, linkpath, control-key, data-list, data-area, end.)
The WRITV command operates by rewriting the record whose IRP is in refer.
Parameters :
Refer:
The field must contain the IRP of the record to be updated.Must not have the value LKxx.
The programming considerations are the same as WRITM DML.
The command is used to delete the master record.The record is deleted by setting it to blanks.The free
space is made available immediately for allocation.
Control-key :
The control key should contain the record key of the master record to be deleted.
Programming considerations:
The record should be read before deletion and in case of online it should be explicitly held.
All the variable records linked to the master has to be deleted before the master record is deleted.
DELVD: Parameters (DELVD status, file, refer, linkpath, control-key, data-list, data-area, end.)
Parameters:
Refer:
Refer must contain the IRP of the record to be deleted.Do not use LKxx.
Upon the completion it contains the IRP of the previous logical record.If the deleted record was logically
the first record then it will contain LKxx.
Programming Considerations:
They are the same as the DEL-M command.
****, CSIZ, ESIZ, FATL, FNOP, FTYP, FUNC, ICHN, ICOR, IPAR, IRLC, ISIZ, LOCK, MFNF, MLNF,
MRNF, NACT, NHLD, NMLK, NOIO, NOTO, NSMR, REPC, RFLK, UCTL, VFNF, VLNF, XERR.
**************************************************************************************
Retrieval Category:
READD: Parameter (READD, status, file, refer, linkpath, control-key, data-list, data-area, end)
Parameters :
Refer:
Defines the field containing the IRPof the variable record to be read.Do not use LKxx.
Upon completion this will conatin the IRP of the record read.
End:
It should conatin one of the following :
END. – if the record is to be held.
RLSE – if the record is not to be held.
Parameters:
Control-key:
This field must contain the record key of the record to be fetched from the master file.
**************************************************************************************
READV: Parameters ( READV, status, file, refer, linkpath, control-key, data-list, data-area, end)
The READV command operates by logically following the forward pointers along a specified linkpath to
read a record.
Parameters:
Refer:
Defines the field containing LKxx or the IRP.
If refer contains the LKxx the first logical record is retrieved in the chain.
Upon completion, refer contains the IRP of the record just read.
The value .END is placed in the refer if the rpevious read was end-of-the-chain.
The READR command operates by logically following the backward pointers along a specified linkpath to
read a record.
Parameters:
Refer:
Defines the field containing LKxx or the IRP.
If refer contains the LKxx the last logical record is retrieved in the chain.
Upon completion, refer contains the IRP of the record just read.
The value .END is placed in the refer if the rpevious read was beginning-of-the-chain.
**************************************************************************************
FINDX: Parameters ( FINDX, status, file, qualifier, argument, data-list, data-area, end.)
This is used for retieving reords based on certain criteria by serial search.
Parameters:
Status: The status ENDC and END. indicate the end of the search process.
Qualifier:
BEGN
KEY=CONTROL-KEY
RRRR
If BEGN is specified the FINDX starts searching from the first physical rcord in the master file.
If a control key is specified then the search starts from the record having the control-key.
If the IRP is mentioned the search starts from that particular location.
FORMAT 1:
BEGN: It indicates that the search has to be performed from the first physical record of the file.
RRRR: It is the IRP from which search has to be performed.
SKIP: It is used to optimise the search by skipping the blank records that are blank.After the first
execution of the FINDX command the number of non-blank records in a cylinder is loaded into the field.
As each non-blank records are searched the counter gets decremented and when it reaches zero the search
continues to the next cylinder,thus optimizing the performance.
SERIAL: It is used when the search has to be done without any regards to the LINKPATH.The search will
continue serially and each record in the file will be tested for the condition.
LINKPATH: It is used to direct the search along the logical path and the search begins at the head of the
chain.
If the search has to be continued for another chain the field RRRR should have a value NEXT to indicate
the serach is carried over to the next chain.
FORMAT 2:
LINKPATH: It is used to start the search from the first record in the chain matching the control-key.
KEY: It will contain the control-key to detect the first variable record at the head of the chain for the
corresponding master record.
After the head of the chain is found the format is set to FORMAT 1 and the search continues.
Arugument :
This field is used to give the search criteria.
Format :
Element1[,]Element2[,]Element3[,]……Elementn[,]END.OPERATOR.val1[val2val3….valn]END.
Element1[,]Element2[,]Element3[,]……Elementn[,]
These are tha names of the elements upon which the comparison has to be performed.
These elements do not need to bee present in the datalist or area.
END.
Specifies the end of the parameter list.
.OPERATOR.
A 2 character entry which compares the element with the value.
The syntax are:
.GT., .LT., .EQ., .NE., .GE., .LE.
val1[val2val3….valn]
A list of data with which the element is compared.
**************************************************************************************
RDNXT: Parameter ( RDNXT, status, file, qualifier, data-list, data-area, end.)
This is used to serially retrieve records from the master and variable files.
The parameters and the error codes are all similar to the FINDX command.
**************************************************************************************
For using the files from the A region use the following libs:
//STEPLIB DD DSN=TISXA.DCHASUP.INTERFLM,DISP=SHR
// DD DSN=TISXA.DCHASUP.LINKLIB,DISP=SHR
// DD DSN=TISXA.DCHASUP.ENVLIB,DISP=SHR
//CSIPARM DD DSN=OM60.CTLCDLIB(DCHASUP),DISP=SHR *DESC SUPRA
In production:
FORWARD:
OODV-IO.
BACKWARD:
OODV-IO.
QA:
1. How do we handle the task/file initiation for a COBOL module with SUPRA calls for update?
Ans. In the SINON command the access method has to be UPDATE.The REALM mode in the SINON
option has to be SUPD.
2. What are the causes for the status NOTO? ( We got this error quite often initially)
a) The TOTAL/SUPRA region is down.If the region is down in test confim with the other team members
if they had brought the region down for their testing.If not the OCS/SS team might be testing (we share
the same testing regions with them). Coordinate with them as to when we can bring the region up.
b) If you are accessing the production files make sure you login from TSOH2;else NOTO status will
occur.
c) If you are accessing the test region check if your run JCL has the line /*RESOURCE SYSTEM3 in the
job card for production it should be /*RESOURCE SOTS.
Ans. All our ID’s have access to production files and we can update them.So it is very important that we
ensure that we check and recheck that we are only aceesing the test region and do not touch the production
database.
Ans. We need to run a CLIST SUPRATA ( for CISCDCHA region) or SUPRATD ( for CICSDCHD
region). The authorization is available for only H03AEVK id to run the CLIST.
5. What are the files that get updated in the different regions?
Ans. The data from the production will be reflected in the files OM60.XXXX.
The data from CICSDCHA will be reflected in the files OM60.XXXXT1.
The data from CICSDCHA will be reflected in the files OM60.XXXXT6.
1. How to walk thru’ a chain of variable records from the beginning of the chain to the end ?
2. How do we delete a master record?
3. How do we relink a variable record from a master record to another?
4. How to store a variable record which has to master records?
5. How to store coded variable records?
6. How do we modify the record code for the coded variable records?