David, It actually had the tab highlighted. I switched to Raw Data to see if it made a difference.
I am a UA member and was logged in, so unsure what the 'unauthorized' represents.
I had the orange cat as per the base graphic here. I tried to reverse the colours one day and the cat turned a "blue haze". I updated the graphic at UA and modified the current one here.
I have a nice gif on accessforums.net
The link to the sample by @MajP is more aligned with how I would use a UDT than the sample by ChrisO which shows multiple occurrences of a single item.
The one piece of COBOL that i actually miss is the natural use of what VBA calls a UDT. Here's an example that UDT solves although I'm not sure you can get an array in also the way this does. the numbers show the hierarchy. This is a record layout and the 01 level lets you reference the entire record as a string and move it around or pass it to a different procedure. The Pic() clauses define the data type. In this case, they are some text and some integers. You can refer to SCF-Last-UPDT-YYMMDD or to just the month part of the field. The array is two dimensional in the sense of VBA arrays because each of the 31 instances is broken down into multiple fields. But is one dimensional in the COBOL would. You would need a subordinate OCCURS clause to have multiple dimrnsions. When you define the array, you also assign a variable name as the index. You use the same syntax as VBA to reference it. SCF-START-HHMM (SCF-DAY-IDX)
Yes, @The_Doc_Man mentions DEC machines and their DIBOL/DBL is very useful like that. You can have a 400 byte record size made of fixed length elements of various sizes, and manipulate either the whole record or the individual fields. Very helpful at times.
The link to the sample by @MajP is more aligned with how I would use a UDT than the sample by ChrisO which shows multiple occurrences of a single item.
The one piece of COBOL that i actually miss is the natural use of what VBA calls a UDT. Here's an example that UDT solves although I'm not sure you can get an array in also the way this does. the numbers show the hierarchy. This is a record layout and the 01 level lets you reference the entire record as a string and move it around or pass it to a different procedure. The Pic() clauses define the data type. In this case, they are some text and some integers. You can refer to SCF-Last-UPDT-YYMMDD or to just the month part of the field. The array is two dimensional in the sense of VBA arrays because each of the 31 instances is broken down into multiple fields. But is one dimensional in the COBOL would. You would need a subordinate OCCURS clause to have multiple dimrnsions. When you define the array, you also assign a variable name as the index. You use the same syntax as VBA to reference it. SCF-START-HHMM (SCF-DAY-IDX)
I know you are joking but -- Redefines is used for two reasons. One, the input/output is variable (and out of your control. You would never use redefines on the programs working variables). Two, you need to reference a group item as numeric but want to have a subdivision. So for example, All group items (ones with subdivisions) are treated as text but you might want to treat one as numeric so technically SCF-LAST-UPDT-YYMMDD is a string. you could redefine it if you needed it to be numeric for some purpose. A more rational use would be for an Amt field that is defined as 99999V99 where you want jus the dollars or cents. you could redefine and break down the details as Dollar pic 9(5) and Cents 9(2), The "V" means the decimal point is assumed but not really there.
No, I was absolutely serious.
It was a blast from the past for me when you posted #85, and I feel REDEFINES deserves a mention.
Not sure you can do the same in VBA?
O very much so! I understand that while GoTo's are generally bad, they do have their purpose and should be used only sparingly. The rest of the conversation was quite educational, even though a lot of the terms being thrown around required a google search to keep remotely following the conversation
No, I was absolutely serious.
It was a blast from the past for me when you posted #85, and I feel REDEFINES deserves a mention.
Not sure you can do the same in VBA?
Well, I don't know if COBOL is identical to DIBOL/DBL but the latter had two number formats.
One was a character decimal, where you defined a number as say D8.2 where you had an 8 figure number with 2 implied dps, The characters were stored as 00345678, but the compiler knew this number was 3456.78. Negatives were shown by a letter at the end.
eg 0034567t where t represented -5 (I think), and therefore this number was -3456.75. You didn't have to specify the dps. You could just assert the dps when you used the number, but you had to be consistent for it to work in this way.
So you could redefine D8.2 as A8 and just treat it as 8 characters. You could change the number characters to produce a different number , and you couldn't store a non-numeric in the numeric field.
But you could also define a field as i4, and now you had a 4 byte long which can store the normal range of longs - but now although you can redefine the i4 as a A4, it's not really meaningful, and hard to change the number by changing one character in the number.
The Picture clause was sort of like a format. But numbers could be physically stored in at least 3 formats. As plain text, which is what the layout I posted shows or binary which we rarely used or as "packed" which was the normal usage. That was two digits to the byte. So a 6 digit date would take 4 bytes because you needed a half byte for the sign. So the high order half byte would be zero 02 20 82 1C for 220821. Or we would just use a 3 digit year rather than waste the half byte.
Those computers that could support it used any of 3 (or 4) different formats. You could count actual numbers with either binary integers or with binary real (floating point). You could count numbers using ASCII strings (a datatype called "number strings" to differentiate from "numbers." AND for those that could handle it, BCD numbers, in which each 4-bit quantity, one digit for each "nibble" of a BCD number (a nibble = 1/2 byte) The digits for 0-9 were actual digits. The other six possible nibbles were specialty flags. One was a minus sign. The others were something else.
IBM's 360 architecture supported BCD, as did Digital, Motorola (mostly in micro chips), Intel, TI, and a few other chip makers.