<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: taimenwillems</title>
    <description>The latest articles on Forem by taimenwillems (@taimenwillems).</description>
    <link>https://forem.com/taimenwillems</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1048827%2F02973e6c-4239-4f01-9f5b-c1cd10e7c091.jpg</url>
      <title>Forem: taimenwillems</title>
      <link>https://forem.com/taimenwillems</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/taimenwillems"/>
    <language>en</language>
    <item>
      <title>How to make an XML element optional in a Cobol provider webservice (DFHLS2WS), based on a Cobol structure</title>
      <dc:creator>taimenwillems</dc:creator>
      <pubDate>Sun, 26 Mar 2023 22:39:19 +0000</pubDate>
      <link>https://forem.com/taimenwillems/how-to-make-an-xml-element-optional-in-a-cobol-provider-webservice-dfhls2ws-based-on-a-cobol-structure-4m9l</link>
      <guid>https://forem.com/taimenwillems/how-to-make-an-xml-element-optional-in-a-cobol-provider-webservice-dfhls2ws-based-on-a-cobol-structure-4m9l</guid>
      <description>&lt;p&gt;To make an XML element optional in a Cobol provider webservice (DFHLS2WS), based on a Cobol structure (not from an XSD), you can modify the Cobol structure to include the OCCURS DEPENDING ON clause.&lt;/p&gt;

&lt;p&gt;Suppose you have a Cobol structure that looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;01 MyStructure.
   05 ElementA PIC X(10).
   05 ElementB PIC X(20).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you want to make "ElementB" optional in the resulting XML structure. Then you can modify the COBOL structure by moving "ElementB" to a separate level that can be made optional, for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;01 MyStructure.
   05 ElementA PIC X(10).
   05 ElementB PIC X(20) OCCURS 0 TO 1 DEPENDING ON ElementB-Present.
   05 ElementB-Present PIC 9(1) VALUE 1.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This way, "ElementB" is optional in the resulting XML structure, and its presence or absence depends on the value of "ElementB-Present". If "ElementB-Present" has the value "1", then "ElementB" is included in the XML structure; when "0", it is not included.&lt;/p&gt;

&lt;p&gt;You can then use the modified Cobol structure to define and generate the webservice using the DFHLS2WS utility. Use the Cobol structure as input for the utility to generate the appropriate XML structure.&lt;/p&gt;

</description>
      <category>cobol</category>
      <category>webservice</category>
      <category>dfhls2ws</category>
    </item>
    <item>
      <title>How to create a flexible number of xml-elements in a cobol provider webservice (DFHLS2WS), starting from a cobol-structure.</title>
      <dc:creator>taimenwillems</dc:creator>
      <pubDate>Sun, 26 Mar 2023 22:33:06 +0000</pubDate>
      <link>https://forem.com/taimenwillems/how-to-create-a-flexible-number-of-xml-elements-in-a-cobol-provider-webservice-dfhls2ws-starting-from-a-cobol-structure-4ia7</link>
      <guid>https://forem.com/taimenwillems/how-to-create-a-flexible-number-of-xml-elements-in-a-cobol-provider-webservice-dfhls2ws-starting-from-a-cobol-structure-4ia7</guid>
      <description>&lt;p&gt;If you have a COBOL structure that corresponds to the XML elements of your provider webservice and you want to create an element that can occur from 1 to 1000 times, you can modify the COBOL structure to include a repeating group. This can be done using the "OCCURS" clause in COBOL.&lt;/p&gt;

&lt;p&gt;Suppose you have a COBOL structure that looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;01 MyStructure.
   05 ElementA PIC X(10).
   05 ElementB PIC 9(5).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you want "ElementB" to be able to repeat 1 to 1000 times in the resulting XML structure. Then you can modify the COBOL structure by moving "ElementB" to a repeating group with the 'OCCURS x TO y TIMES' clause, for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;01 MyStructure.
   05 ElementA PIC X(10).
   05 ElementB OCCURS 1 TO 1000 TIMES
      PIC 9(5).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This way, you can repeat "ElementB" 1 to 1000 times in the resulting XML structure, depending on how many times it occurs in the input.&lt;/p&gt;

&lt;p&gt;Then, you can use the modified COBOL structure to define and generate the webservice using the DFHLS2WS utility. You can use the modified COBOL structure as input for the utility to generate the appropriate XML structure.&lt;/p&gt;

</description>
      <category>cobol</category>
      <category>webservice</category>
      <category>dfhls2ws</category>
    </item>
    <item>
      <title>How to Clean Up Snap Versions to Free Up Disk Space</title>
      <dc:creator>taimenwillems</dc:creator>
      <pubDate>Sun, 26 Mar 2023 21:29:06 +0000</pubDate>
      <link>https://forem.com/taimenwillems/how-to-clean-up-snap-versions-to-free-up-disk-space-22o2</link>
      <guid>https://forem.com/taimenwillems/how-to-clean-up-snap-versions-to-free-up-disk-space-22o2</guid>
      <description>&lt;p&gt;(see: &lt;a href="https://www.debugpoint.com/clean-up-snap/"&gt;My source of information&lt;/a&gt;)&lt;/p&gt;

&lt;h4&gt;
  
  
  Symptom: the partition containing &lt;code&gt;/var&lt;/code&gt; is running out of diskspace.
&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;OS: Linux Ubuntu&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This quick guide with a script helps to clean up old snap versions and free some disk space in your Ubuntu systems. &lt;/p&gt;

&lt;p&gt;Snap can consume a considerable amount of storage space because it keeps old revisions of a package for retention.&lt;/p&gt;

&lt;p&gt;The default value is 3 for several revisions for retention. That means Snap keeps three older versions of each package, including the active version. This is okay if you do not have constraints on your disk space.&lt;/p&gt;

&lt;p&gt;But for servers and other use cases, this can easily run into cost issues, consuming your disk space.&lt;/p&gt;

&lt;p&gt;However, you can easily modify the count using the following command. The value can be between 2 to 20.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;snap &lt;span class="nb"&gt;set &lt;/span&gt;system refresh.retain&lt;span class="o"&gt;=&lt;/span&gt;2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Clean Up Snap Versions
&lt;/h2&gt;

&lt;p&gt;In a post in SuperUser, Popey, the ex-Engineering Manager at Canonical, &lt;a href="https://superuser.com/questions/1310825/how-to-remove-old-version-of-installed-snaps/1330590#1330590"&gt;provided&lt;/a&gt; a simple script that can clean up old versions of Snaps and keep the latest one.&lt;/p&gt;

&lt;p&gt;Fire-up nano to create a new script in &lt;code&gt;/bin&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /bin/clean_snap.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here’s the script we will use to clean the Snap up.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
 &lt;span class="c"&gt;#Removes old revisions of snaps&lt;/span&gt;
 &lt;span class="c"&gt;#CLOSE ALL SNAPS BEFORE RUNNING THIS&lt;/span&gt;
 &lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="nt"&gt;-eu&lt;/span&gt;
 &lt;span class="nv"&gt;LANG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;en_US.UTF-8 snap list &lt;span class="nt"&gt;--all&lt;/span&gt; | &lt;span class="nb"&gt;awk&lt;/span&gt; &lt;span class="s1"&gt;'/disabled/{print $1, $3}'&lt;/span&gt; |
     &lt;span class="k"&gt;while &lt;/span&gt;&lt;span class="nb"&gt;read &lt;/span&gt;snapname revision&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
         &lt;/span&gt;snap remove &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$snapname&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="nt"&gt;--revision&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$revision&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
     &lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the file by pressing &lt;code&gt;ctrl&lt;/code&gt;+&lt;code&gt;x&lt;/code&gt;, &lt;code&gt;y&lt;/code&gt; in nano.&lt;/p&gt;

&lt;p&gt;Make it executable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo chmod&lt;/span&gt; +x /bin/clean_snap.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CLOSE ALL SNAPS and then run the script to clean old snaps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt; /bin/clean_snap.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>ubuntu</category>
      <category>snap</category>
    </item>
  </channel>
</rss>
