Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. BettyScherber

    "CONTINUE" as first line in Procedure Division ??

    Back in the mid 70's, I had a FORTRAN programmer working with my on a COBOL project. In FORTRAN, variable names at that time were limited to six characters and those that began with the letters I-N were integers unless you specifically defined them to be otherwise, so she had elected to name...
  2. BettyScherber

    Converting alphanumeric field to numeric

    Of course, this will only work when the values are left justified and contain legitimate numbers, but it's short: 01 DOLLAR-VALUE PIC 9(5)V99. 01 WORK-FIELD PIC Z(5).99. 01 REDEFINES WORK-FIELD. 05 INTEGER-PORTION PIC X(5) JUST RIGHT. 05 DECIMAL-POINT PIC X...
  3. BettyScherber

    Want code snippet to validate decimal number

    Since you requested a snippet, I thought you might appreciate this, it's relatively short: In WORKING-STORAGE: 01 REQUIRED-VARIABLES. 05 NUMBER-TO-PARSE PIC X(20). 05 SIGN-CHAR PIC X. 88 NUMBER-IS-NEGATIVE VALUE "-". 05 INTEGER-CHARS PIC X(18) JUST RIGHT. 05...
  4. BettyScherber

    Pointers in Cobol

    I believe that you will still need to use pointers, because the arguments are defined as pointers. To create a pointer, code something like this: 01 LNK-MODULE-NAME-PTR USAGE POINTER. then you should be able to fill it in the PROCEDURE DIVISION with this code: SET...
  5. BettyScherber

    Importance of clear code

    I always tell my students that you should write your code for the benefit of the next programmer, because more often than not the next programmer is you. (:I Betty Scherber Brainbench MVP for COBOL II http://www.brainbench.com
  6. BettyScherber

    Direct Table Lookup

    It is difficult for us to tell whether you are getting the redefines and the procedure division wrong, because you have not shown us your code. #-) Betty Scherber Brainbench MVP for COBOL II http://www.brainbench.com
  7. BettyScherber

    What's the result?

    Speaking of the vendor being happy to fix things, I used to be on the COBOL compiler team at NCR. At the request of a customer, we fixed LINAGE, which wasn't working according to the ANS specification. This annoyed everyone whohad previously figured out what it was actually doing and used it...
  8. BettyScherber

    Level of using "OCCURS" clause

    I've seen a couple of compilers that will accept this, but recommend you avoid coding OCCURS on the 01, because it is not standard, and therefore not portable. Betty Scherber Brainbench MVP for COBOL II http://www.brainbench.com
  9. BettyScherber

    updating file with one record

    This is not terribly efficient, but it's guaranteed to work, even without restructuring the file. CLOSE the file and re-OPEN it after the WRITE. Betty Scherber Brainbench MVP for COBOL II http://www.brainbench.com
  10. BettyScherber

    Start Greater Than query

    Actually, COMP is more often BINARY than PACKED-DECIMAL, though, of course, there is no standard, and in BINARY the ZERO is indeed LOW-VALUES. Betty Scherber Brainbench MVP for COBOL II http://www.brainbench.com
  11. BettyScherber

    ASCII PACKED

    Fabio - You may or may not get the format you want, depending on who is interpretting your instructions. Providing the person with examples, may help, but I have found it often doesn't. Some of these "newfangled" tools just don't handle numeric formats the same as good old COBOL...
  12. BettyScherber

    Converting a packed field

    Here's a trickier, but much shorter piece of code. WORKING-STORAGE: 01 TRANSLATE-DATA PIC 9(4) BINARY VALUE ZEROS. 01 REDEFINES TRANSLATE-DATA. 05 PIC X. 05 TRANSLATE-BYTE PIC X. 01 FIRST-NIBBLE PIC 99. 01 SECOND-NIBBLE PIC 99. 01...
  13. BettyScherber

    Am I Correct here

    CEH4702: Actually, END-SEARCH is not an IBM extension. It is standard ANS-COBOL beginning in COBOL-85. Betty Scherber Brainbench MVP for COBOL II http://www.brainbench.com
  14. BettyScherber

    font sizes

    This is not so much a question of compiler, as a question of printer. Most printers have some sort of control sequence you can send to accomplish this. You simply have to intermingle the control sequence(s) with your text to be printed. You can switch your fonts back and forth at will to...
  15. BettyScherber

    Ignoring case comparing ASCII files

    Chitownjoe - Your problem is with your INSPECT statements; specifically, you want an INSPECT CONVERTING not an INSPECT REPLACING. The CONVERTING replaces any occurrence of any character from the first string with the character in the same position in the second string. The REPLACING...
  16. BettyScherber

    Sorting Tables

    Thanks, Ronald - It was a lot more fun to write and debug than a plain old bubble-sort program. Of course, I did wind up having to put in a big delay-loop to slow it down enough so we humans could watch it happening. Betty Scherber Brainbench MVP for COBOL II http://www.brainbench.com
  17. BettyScherber

    USING ARRAY AS VARIABLE

    If IBM is equating arrays w/tables, why are we arguing? For the same reason that we argue with things said by that big company in Redmond. Just because you have more money doesn't make you right. Betty Scherber Brainbench MVP for COBOL II http://www.brainbench.com
  18. BettyScherber

    Sorting Tables

    As an old COBOL programmer wanting to learn new tricks, I once took a Visual Basic class. One of our assignments was to write any program that used a "Bubble Sort". Having implemented the algorithm in many different languages over the years, I found a way to make it interesting...
  19. BettyScherber

    File Status Description

    Slade- Actually Saginaw's definition is the ANS standard and yours is an IBM extension. In any case, according to ANS COBOL the 9x file status is implementor defined and it is up to the individual implementor what character they use for the second position. I've seen lots of different...
  20. BettyScherber

    USING ARRAY AS VARIABLE

    The COBOL language comes in modules. To qualify as a COBOL compiler at some specific level, you must pass tests which determine whether you have implemented the module at the low or high level. The module which handles multiply occurring data items is called the Table Handling Module - don't...

Part and Inventory Search

Back
Top