This video shows how to manage source code through skeleton programming. To fully understand it, you must be familiar with the principles explained in the video titled “Data description in the kernel facet”. Skeleton programming is available in the kernel and the COBOL facets but this video focuses on the COBOL facet. To manage source code, you must complement the data description entities, also present in the kernel facet. The Data entity corresponds to the Data Element entity in the kernel facet. Its editor contains a COBOL Definition tab where COBOL attributes such as the alias or formats are specified. The Data Aggregate editor also contains a COBOL Definition tab with COBOL attributes. Its Components tab includes COBOL information such as the occurs or the primary key. The Skeleton entity represents a model for all the programs that instantiate the Skeleton. It can be any model (with an ALL type) or a COBOL model. In this demo, we will study COBOL Skeletons. Let’s create a COBOL Skeleton and open its Source tab. The Skeleton contains the structure of a COBOL program, which can be clearly seen in the Skeleton Structure view. The COBOL source code is constituted of tags. A child tag starts with the tag of its parent, complemented by its own tag name. The tag declaration line is followed by one or more continuation lines with the tag contents. Variables, which start with a $, will be replaced by their values upon generation. Some variables, like $programid, have a predefined value. The other variables can be assigned values in the Properties Description table of the Skeleton or the Program. A COBOL Skeleton must be called in a COBOL Program. When you create a COBOL Program, you must select a COBOL Skeleton. In the Program Source Definition tab, you can modify the default generation target to separate the generated files from the design file. Let’s generate the Program. The content of the generated file (the cbl file) comes from the Skeleton. The COBOL structure can be easily viewed in the Generated Code Structure view. You can enter specific code lines in the Program. To display the content assist, press CTRL + the space bar. The specific lines stand out in the Generated Code Structure View. The specific code lines remain even if you generate the code again. You can modify the Skeleton. For example, you change the SOURCE COMPUTER line. In the Design Explorer view, you can display the Skeleton super references to see the impact of the change. You can see that the Skeleton is referenced in a Program. And indeed, this COBOL file is now displayed as desynchronized. The Generation Manager view corroborates the desynchronization, since the file is marked as to be regenerated. So, let’s generate it again. The modification of the Skeleton is integrated into the COBOL code and the specific code lines are still there. An easy way to insert blocks of specific lines at various places in the COBOL code of a Program is to call a Static Micropattern. When the micropattern is called, the code lines that it contains are added right after the micropattern call in the Program code and in the COBOL tags that you specify. In the Micropattern Blocks tab of the Static Micropattern editor, you enter blocks of code lines. You indicate the ID that identifies the block of code lines and the COBOL code. The variables, which start with a $, will have to be assigned values in the calling Program. You can add tags to specify where other code lines must be inserted. You indicate the tag name and the COBOL code. You must enter the tags as they are indicated in the Source tab of the Skeleton. In this example, the code of the WORKING tag will be inserted in the WORKING-STORAGE SECTION. Then, you must call the Static Micropattern in the Program by using the Snippets view. In the snippet creation wizard, you enter the Static Micropattern project, name and block ID. When you click Insert, the RPPMPF snippet is inserted. Now, you must assign values to the 3 variables of the Static Micropattern code lines. When you generate the Program again, the Static Micropattern is expanded right after its call. Moreover, the code line from the WORKING tag is now included in the WORKING-STORAGE SECTION. A more complex but customized way of inserting blocks of specific lines is to create a micropattern in a dedicated Eclipse plug-in and to write its content directly in Java. Then, this micropattern can be called in the Program code. For this demo, a SRVCALL Java micropattern has been written. You can call it in a Skeleton or a Program. In this example, we call it from the PROG Skeleton and we enter its property directly in the call line. The Skeleton is called In the PRG01 Program. The Skeleton property is overwritten. When the Program is generated again, the micropattern is expanded. You can be sure your design and code are error free by activating the quality control. If you right-click a project and select Software Analyzer>Software Analyzer configuration>Rules, you can see the activated RPP rules. For example, “Do not overwrite generated code” is activated. So, for example, you change the time in the DATE-COMPILE generated line of a Program. Then you save, and run the SDK quality control on the project. A warning is raised. Then, you won’t be able to deliver the modification if the administrator has activated the quality control upon the deliver. Note that you can write your own rules in Java. This is the end of this video. You can discover more features in the documentation. Thank you for watching!