Good spot Gerard. That's the problem with comments. They aren't compiled, executed and tested, so only humans can spot when they are wrong...
I agree with Steve. LINKAGE SECTION. 01 something PIC X. PROCEDURE DIVISION USING something. MOVE something ( 1 : 20 ) TO somewhereelse MOVE something ( 1 : some20fromws ) TO somewhereelse The first MOVE is a compile error. The second is... down to the behaviour of the compiler. In Enterprise COBOL up to V4.2, it did the MOVE "correctly" (moved 20 bytes in this case). Initially with the new V5+ (rewrite of code-generation and optimisation) the behaviour changed. However, this cause too many problems,...
Hi Michael, welcome. COBOL programs have an overarching structure of four DIVISIONs: IDENTIFICATION (or ID if you are able) DIVISION, where you put all the stuff to "identify" the program, which these days needn't be much. PROGRAM-ID is just the name of the program; ENVIRONMENT DIVISION, where you establish the conditions under which the program is going to run, including connecting internal files to external files; DATA DIVISION, where all data is defined; PROCEDURE DIVISION, where you write all...
Awsome thanks alot guys. Tried the export COB_PRE_LOAD = functions and it worked. hello.cob IDENTIFICATION DIVISION. PROGRAM-ID. hello. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS_KEY PIC X(20). 01 WS_VALUE USAGE BINARY-SHORT SIGNED. PROCEDURE DIVISION. initialize WS_KEY. string "gri" delimited by size, low-value delimited by size into WS_KEY CALL "MapExample" USING BY reference WS_KEY RETURNING WS_VALUE. DISPLAY WS_VALUE. STOP RUN.
Yes, but perhaps someone faced with 3000 stand-alone programs using PARM might shy away from GnuCOBOL if they had to change them all just for that... A general program which just "pretends to be the OS" and does a (dynamic) CALL with the PARM data correctly formatted (from whatever source is required) would be one way to deal with it without 3000 program changes. PARMDD is very interesting. You could use one record of 32760 bytes (there's a caveat) to provide 32760 bytes of data. Or you could use...
For IBM Mainframe MVS or zOS, if no PARM (or PARMDD) data exists in the JCL, the 16 bit signed integer length of the PARM data will be zero. http://ibmmainframes.com/viewtopic.php?t=15326&highlight=parm+linkage+cobol As Bill Woodger explained, PARM (or PARMDD) data is a single character string, conceptually like a punch card. PARM data could be 0 to 100 bytes long, and PARMDD data could be 0 to 32,760 bytes long. If the LINKAGE section record is 100 bytes or less, the program has no way to tell if...
A lump of data is passed. It is up to the program to make sense of it. "a,b,c,d" on the PARM= arrives as that value, prefixed by a two-byte binary indicating the length of the data (excluding the length of the length). Run-time options can also be specified in the PARM/PARMDD, separated by a forward-slash, and whether the COBOL parm-data is to the left of right of the slash depends on a run-time option. PARM="a,b,c,d/someruntimeoption" or PARM="someruntimeoption/a,b,c,d" would arrive to the COBOL...
:-) And then copy/paste to outside the structure and the code behaves differently...
The END-PERFORM terminates the IF, see 2) below: 14.5.2.1 Explicit scope termination...
Good news is that you can request warnings for missing "end-" constructs. Bad news...
Hello everyone! So about a month ago I asked about statistical functions and I finally...
Here's another alternative: PERFORM UNTIL EOF = "TRUE" READ INFILE INTO WS-INFILE...
I have no problem getting to see the errors, with line numbers and lines marked....
Enterprise COBOL has been made ready for 64-bit addressing, but customer "use cases"...
You also try to use 88s in a calculation. You can't do that, just use the condition...
Overlapping MOVE?
You wrote E0F-N with zero (0) instead of the letter O. And then you have to correct...
ANY LENGTH with PREFIXED BY? If that is not supported yet, OCCURS DEPENDING ON, 0...
You can do some of the Computer Sciencey stuff now: contained programs. Want paragraphs...
By the "one true style" I mean that one particular type of Mainframe COBOL system...
This could easily be again long and without clear understanding between us :-) Why...
If you dig into the link László provided (on 03/30) to his sample programs, you'll...
Works fine with the GnuCOBOL 2.00 that I have, from January last year (I really should...
Why don't you just test for space? I'd suggest you try with a more recent GnuCOBOL....
There are many editing symbols which can be used in combination. Not all combinations...
If you need to embed the same literal value as is being used to delimit the literal,...
If you need to embed the same literal value as is being used to delimit the literal,...
If you need to embed the same literal value as is being used to delimit the literal,...
Are the "strings" actual strings, or fixed-length fields?
No, no THROUGH :-) An easier way than hitting the books is to look here: http://www.cobolstandard.info/j4/files/std.zip...
Good news and bad, I think. Good news, the ALL subscript in functions does exactly...
It is by design. When COBOL was designed, mostly, perhaps exclusively, programs would...
Grace Hopper and compilers. Described as one of the 50 things that made the modern...
Seems that a reply I made on the other thread went missing. If you use SELECT OPTIONAL,...
I have just run the test program with recent svn version in old MinGW environment,...
I can run your code on Ubuntu, and all works as expected. If I deliberately leave...
Thinking about it, for the "file already open" you should get a FILE STATUS of 41,...
Did you CLOSE the file before the sub-program CALL? Anyway, use a sub-program, rather...
If you don't have the volumes of data to need a Mainfame, you don't need one. Which...
My first answer to "how do I find the length of (something)?" is "don't lose it in...
an INVOKE statement on an object reference that is not a universal object reference,...
If you pay for CPU usage, you try to reduce "meaningless" overhead (those things...
If ANY LENGTH was available in the compiler used... What is not going to happen is...
https://www.youtube.com/watch?v=HisD_pqlRHQ 58 and 57 add up to... reason for that...
https://www.youtube.com/watch?v=HisD_pqlRHQ 58 and 57 add up to... reason for that...
The "performance" point was about other technicques which use different lengths in...
Only found this comment now :-) EC-PROGRAM-ARG-MISMATCH and EC-PROGRAM-ARG-OMITTED...
Ah. Goldilocks. The way to look at it is, it justifies the field, not the content....
Is ADDRESS OF allowed in the USING of a CALL with GnuCOBOL? IBM's Enterprise COBOL...
Extremely accurate guessing, thanks, Brian.
Good to see you abrogard. Hercules. IBM would like to build a time machine, use it...
Thanks Klaus. When I looked at the second image, I even found myself pressing PF3...
Pat, have a look at the Simotime website, I think there is some 370/Assembler stuff...
With that data, I'd just define a group, consisting of three fields, PIC X(5), PIC...
Do you have a reference for that, Brian? They just look unstructured, with no variance...
The NIST programs are not "well structured" :-) and I'd also not base anything much...
The NIST programs are not "well structured" :-) and I'd also not base anything much...
It would be entirely dependent on implementation and hardware. A "file handler" in...
https://xkcd.com/1328/
Hi. Here is an example of how I handle printers on Windows 10. SELECT PRNREP ASSIGN...
Well, since there is no indication anywhere else that it is valid, including in the...
Yes. To add a few things. If using a data-name, the length does not actually matter...
It is not indicated from the IBM syntax diagrams that multiple FOR without a separate...
The way I remember it is that all member names (program names) in IBM PDS libraries...
That link is for Micro Focus's "managed COBOL", but probably the same diagram elswhere...
The diagram is at fault when taken in isolation from the text, but I've not thought...
That link is for Micro Focus's "managed COBOL", but probably the same diagram elswhere...
Can you point to where this is documented as an IBM Extension? Enterprise COBOL has...
Ola, Mario, It is never better to stay silent :-) I think yourself and Simon misunderstand...
What did I do? Any idea of how many combinations there are, with up to 18 numeric...
* 0.00 to -$$,$$9.99: - $0.00 * 0.00 to -$$,$$9.99: - $0.00 Incorrect "-", should...
? 0.00 to $$,$$$.$$-: $.00 ? 0.00 to $$,$$$.$$-: $.00 ? 12345.67 to --,---.---: 2,345.670...
Well, there's some things wrong there, but I don't agree on everything. Having the...
Mario, It's like this: since 1979 I've hardly ever coded floating currency-symbols...
"Standard" behaviour is that you can only have one floating editing symbol. In practice,...
01 neTest PIC ---,---,--9.9.
You mean you are using GnuCOBOL and you would like to know how to prevent Ctrl-Z...
Runtime 90% of the time is spent executing 10% of the code. Development time The...
Funny, I just fixed the "obvious" typo, then found it came from Wikipedia :-), and...
Runtime 90% of the time is spent executing 10% of the code. Development time The...
Examine/set sound like the PEEK and POKE of BASIC. Obtain the value at a particular...
Results confirmed, 100% accurate and as expected. For more involved examples: http://stackoverflow.com/q/14272981/1927206,...
No :-). Firstly, since I don't use "expressions" in IF, I was unsure, so said I'd...
No :-). Firstly, since I don't use "expressions" in IF, I was unsure, so said I'd...
Yes, expressions in an IF (or any condition) are valid, as are the use of FUNCTIONs....
Tried it with GnuCOBOL. DISPLAY with an expression does not work for either GnuCOBOL...
It is all in Appendix A, Intermediate results and arithmetic precision. Yes, given...
Doesn't take long to realise it is recognisable behaviour... but took too long, due...
Doesn't take long to realise it is recognisable behaviour... but took too long, due...
Well, I don't use expressions in IF, but I'll check it. I don't recognise that behaviour....
Well, I don't use expressions in IF, but I'll check it. I don't recognise that behaviour....
Yes, all IBM compilers. There are detailed explanations in the Programming Guide....
Yes, but a terminator-period is defined as being followed by a space, so you have...
The program is estimated at about 50 years old. I kind of think by a FORTRAN rather...
Boa noite Mario, But 188 is not the answer Gael wants. Gael wants the same answer...
Boa noite Mario, But 188 us not the answer Gael wants. Gael wants the same answer...
Thanks Edward. I've not see "implementor defined" for this, but looking at that draft...
And just to add, here's an example of a COMPUTE that Gael has, all fields are integers....
You could search-engine for "cobol two file match". Bear in mind, it is the internet,...