SDMOD

PURPOSE:  SDMOD is an equated command used to assist you in making changes to an SD which already has one or more DS's associated with it.  SDMOD first lets you make changes to the DS then compiles it.  If necessary it will convert the data in the associated Data Sets and resave all the Data Indexes (DI) and Process Modules (PM) that use these DS and SD.  It cannot be used with multiple record types.

Converted DS’s are given the same names as the old DS’s.  This eliminates any need to modify the existing application programs.  SDMOD also offers the option of retaining the old DS’s.  It provides a program to restore the original SD and DS’s if needed.

The SD being modified in SDMOD can have up to 999 DS’s, DI’s, and PM’s associated with it.

Syntax

SDMOD [expert]

SDMOD [expert]

SDMOD performs data conversion through a series of simple questions.  On-line help is available throughout SDMOD by entering a question mark to any SDMOD prompt.

expert

use expert if you do not want to examine data sets before they are converted.

EXAMPLE

In the following example, an SD and its primary DS are listed out before using SDMOD to make the following data conversions:

  1. change data type for ROYALTY from FLOAT to INT

  2. add a new field IN_STOCK

  3. delete the current field ADVANCE_AMT

*LIST SD BOOKS2<CR>
00100   TITLE_CODE,CHAR,6
00110   TYPE_CODE,CHAR,12
00120   PRICE,FLOAT,10,2
00130   ADVANCE_AMT,FLOAT,10,2
00140   ROYALTY,FLOAT,3
00150   PUB_DATE,DATE
*USE DS BOOKS2<CR>
*EXTRACT<CR>
CP2264   computer   20.00   .00   10   05/10/90
FL0834   for_lang   11.95   .00   8   11/18/90
NF5321   non_fict   17.89   100.00   7   08/16/90
SF6798   sci_fi   15.50   250.00   5   07/14/91
TR4409   travel   7.40   .00   10   03/12/91
*SDMOD<CR>

After the SDMOD Utility is invoked, a banner is displayed on the screen.  See the NOTES subsection for the contents of the banner.  Press the Return key to continue past the banner.

If a Data Base Library (DBL) has not been declared prior to invoking SDMOD, it will prompt for the DBL which contains the SD for conversion.  At this point, enter the DBL name or exit SDMOD by pressing <Return>.  Responses to prompts are in bold print.

Enter ? at any prompt for HELP.
DBL Name or press <RETURN> to quit: BOOKS<CR>

Next, SDMOD prompts for the SD to be modified.  "QUIT" may also entered at this point to exit SDMOD.

SD Name or press <RETURN> to quit: BOOKS2<CR>

SDMOD invokes the editor specified in the system field @EDITOR.  The specified SD becomes available to modify.  After changes have been made and the editor is exited, SDMOD gives the option of disabling the VALID IF clauses, if any exists in the new SD.  If the VALID IF clauses are not ignored, fields with data that do not pass the validation criteria will be left blank.  If the VALID IF clauses are ignored, all fields will be converted into the new DS’s (whether they have valid values or not).

Do you want to ignore VALID IF clauses? (Y, N or ? <CR>=N): <CR>
PROCESSING... PLEASE WAIT.
Now converting DS BOOKS2...

SDMOD attempts any data conversion allowed by the CONVERT command.  If a field value cannot be converted, a warning message is written to SD_impact.log and the field for the record is left blank.  For example, if a field is converted from CHAR to ALPHABETIC, a field value such as "A6X" cannot be converted to the new DS since it contains a "6".  In this case, the field containing this value would be left blank and a warning message will be printed.  It is good practice to check for the file after running SDMOD to ensure proper conversion of all DS’s.

When converting the data, SDMOD renames the old DS’s as ###001, ###002, etc.  The pound signs (###) are prefix symbols using the Process Identification number (PID) as the prefix.  The converted DS’s will automatically be given the names of the original DS’s.

The last prompt in SDMOD asks if the converted DS’s are to be examined before removing the original DS’s.  As a precaution, examine the new Data Sets before destroying the old ones.  If this question is answered with "N", the old DS’s will be removed and SDMOD will continue.  If this question is answered with "Y", SDMOD displays a message on the informing the user to examine the affected DS; and either to continue or restore.  This prompt will not appear in expert mode.

Do you want to examine the converted Data Sets before
the original Data Sets are removed? (Y, N or ? <CR>=Y):<CR>
-----------------------------------------------------------
USE a DS which was affected by the change and examine the date.
Type CONTINUE to continue the conversion or RESTORE to abort.

At the ACCENT R prompt, USE and EXTRACT the new converted DS's to see if the results are satisfactory.  If so, type CONTINUE and SDMOD will continue by resaving any DI's, ID's, CF's and PM's associated with the SD.

If the results are not satisfactory, type RESTORE and SDMOD will delete the converted DS's and rename the original DS's and SD back to their original names.

Now resaving DI BOOKS2...
Now resaving PM QUICK_REP...
Now resaving ID BOOKS2...
Now saving and forming CF BOOKS2...

SDMOD asks if all associated DI’s are to be reformed.  Answering "Y" will reform them, and "N" will leave the indexes in their obsolete form, to be reformed later.

Do you want the DI’s FORMed now? (Y, N or ? <CR>=Y):<CR>
Now forming DI BOOKS2...

The following is a listing of the SD and DS after the conversion.

*LIST SD BOOKS2<CR>
00100   TITLE_CODE,CHAR,6
00110   TYPE_CODE,CHAR,12
00120   PRICE,FLOAT,10,2
00130   IN_STOCK,INT,5
00140   ROYALTY,INT,3
00150   PUB_DATE,DATE
*USE DS BOOKS2<CR>
*EXTRACT<CR>
CP2264   computer 20.00 0 10 05/10/90
FL0834   for_lang 11.95 0  8 11/18/90
NF5321   non_fict 17.89 0  7 08/16/90
SF6798   sci_fi 15.50 0  5 07/14/91
TR4409   travel 7.40 0 10 03/12/91

NOTES:  The SDMOD banner contains the version number of the utility and a few notes.  The notes cover:  1) the editor used to modify the SD is taken from @EDITOR;  2) changing a field name will cause SDMOD to remove the data from that field (the utility assumes it is a new field);  3) the SD must be in a DBL that is in the current directory.  DS’s with logical names that point to another directory cannot be converted (appears only if the DBL being used had a logical in its name).  4) SDMOD will not work with multiple record types.

Logical names and directory names may be used if the SD is in a DBL in the current directory.

SEE ALSO:  RENAME Command, @UNIQUE_ID System Fields, CONVERT Command