Keyboard Shortcuts
Likes
- H390-MVS
- Messages
Search
NJE38 V2.2
NJE38 version 2.2 is now available.? This version now contains the following new features: This software provides an NJE capability to MVS 3.8 that can connect to other remote MVS or VM systems, as well as non-mainframe software that is NJE-capable such as Funetnje.? With NJE38, you can send and receive files with remote nodes using the supplied TSO TRANSMIT and RECEIVE commands or via batch utilities. You could send an entire PDS to another MVS 3.8 system for example, or send source code or a listing file from a TSO userid to a VM userid (or vice-versa) as another example.
|
Re: COBOL in TK4-: Handling Signed Numbers
Ed Liss
On Wed, Jan 6, 2021 at 02:33 PM, Patrik Schindler wrote:
By reading IBM GC28-6396-6 (ANSI COBOL from 1976), I maybe should rewrite:The COBOL compiler with tk? is older than 1976.? Yes it is ANSI COBOL but it dates back to MVT days (1960's). For zoned decimal fields, the sign is always in the low order digit.? You did mention overpunch and back in the day of key punch machines, an "11 punch" was made in the right most position of a numeric field to indicate a negative number.? This practice dated back to mechanical accounting machines that processed punched cards.? It carries on still in the modern IBM world. Example:???? here is how data is stored for COBOL USAGE DISPLAY pictures: PIC 999?? VALUE 3? would be in memory as 003 (hex F0F0F3) PIC s999 VALUE 3? would be in memory as 00C (hex F0F0C3) PIC s999 VALUE -3 would be in memory as 00L (hex F0F0D3) Also, It appears that you are assuming COBOL will align decimal points in data with "V" characters in PICTURES.? That is not true and will result in S0C7 abends. For this example, the simplest way to get the signs would be to define the sign as a separate character and add code to multiply the score by -1 if the sign is "-". |
Re: COBOL in TK4-: Handling Signed Numbers
Hello Mark,
Am 07.01.2021 um 15:58 schrieb Mark Waterbury <mark.s.waterbury@...>: See:That the same article I was referring to in my original post. :-) I did not bother too much with it, because the questioner used SIGN clauses which do not work in the TK4- provided COBOL, and I got somewhat confused by the decimal comma-fullstop-requirement. I¡¯ll look at your privately sent recommendations, implement them and report back. Thanks again! :wq! PoC |
Re: COBOL in TK4-: Handling Signed Numbers
Send me your?code privately. You have my email. Joe On Thu, Jan 7, 2021 at 5:23 AM Patrik Schindler <poc@...> wrote: Hello Joe, |
Re: COBOL in TK4-: Handling Signed Numbers
Hello Bert,
Am 07.01.2021 um 13:53 schrieb Bert Lindeman <bert.lindeman@...>: Why not just use your input file and move the parts into a field with your cobol program so it represents a valid numeric field and THEN format is?The input file (/var/log/mail.log with log output from Spamassassin) is preprocessed on Linux, because: - it contains very long lines (up to 121 chars) and I don¡¯t know how to automatically copy records that big into a dataset from outside MVS, - the lines aren¡¯t fixed format, so I parse them through Perl and a Regular Expression to extract the interesting values, - it will not solve the sign issue, because the input line also has clear text numerics with a sign (if the mail been scanned is not spam, the score value becomes negative). Thanks for your feedback but¡ doesn¡¯t help. :-) That is a procedure COBOL was written for in the first place ;-)If that old COBOL struggles with decimal signs in the first place, I don¡¯t want to bother trying to chop dynamic lines as outlined above. :-) :wq! PoC |
Re: COBOL in TK4-: Handling Signed Numbers
Hello Rob,
Am 07.01.2021 um 12:59 schrieb Rob Prins via groups.io <rob.prins@...>: Indeed, you get an 0C7 abend, because the field contains blanks and periods.Thank you for your explanation. If I¡¯m removing the sign of my input, the data becomes largely invalid, and the complete project is futile. Maybe I should abandon the idea of using ?stone age¡° COBOL for some summing and avg calculations from columns of mixed sign numbers? :wq! PoC |
Re: COBOL in TK4-: Handling Signed Numbers
1 ? ? ?? 10??????? 20??????? 30??????? 40????? 50
+---+----+----+----+----+----+----+----+----+¡ª¡ª+ Jan 07 10:02:29 ? 0005220 3.0 ? ? 823 Jan 07 10:09:45 ? 0002300 3.2???? 21572 Jan 07 10:10:50 ? 0000290 3.8???? 31572 Jan 07 10:12:27?? 0001540 4.1???? 89374 Hi Patrik, Indeed, you get an 0C7 abend, because the field contains blanks and periods. You have defined this field with PIC S9(5)V99. The V in the picture clause is an imaginary decimal point and should not be present in the field. The minus does not not make sense too. Trying the field to move to a PIC +++,+++.99 wil result in a 0C7 because the field will be internally converted to packed decimal and then will be edited in the PIC +++,+++.99 field. The conversion into packed decimal wil result in a 0C7 abend (data exeption) In the example of your input above the move will not abend. The blanks and periods should be removed. Redefine the field does not convert your input. Take your advantage with this "solution". Cheers, Rob |
Re: COBOL in TK4-: Handling Signed Numbers
Hello Joe,
Am 07.01.2021 um 11:15 schrieb Joe Monk <joemonk64@...>: Yep, it abended because I forgot something.Still abends with the move. FD INPILE-FILE LABEL RECORD IS STANDARD RECORD CONTAINS 80 CHARACTERS BLOCK CONTAINS 0 RECORDS. 01 STATISTICS-INPILE-FORMAT. 02 MONTHNAME PIC A(3). 02 FILLER PIC X. 02 DAY-OF-MONTH PIC 9(2). 02 FILLER PIC X. 02 TIMESPEC. 03 T-HOUR PIC 9(2). 03 FILLER PIC X. 03 T-MINUTE PIC 9(2). 03 FILLER PIC X. 03 T-SECOND PIC 9(2). 03 FILLER PIC XX. 02 SCORE-TXT PIC X(7). 02 SCORE-NUM-R REDEFINES SCORE-TXT. 03 SCORE-NUM PIC S9(5)V99. 02 FILLER PIC X. 02 SCANTIME PIC X(7). 02 FILLER PIC X. 02 BYTES PIC X(12). 02 FILLER PIC X(35). WORKING-STORAGE SECTION. 77 SCORE PIC +++,+++.99 VALUE ZERO. All other stuff is unchanged. What could it be this time? :wq! PoC |
Re: COBOL in TK4-: Handling Signed Numbers
Hello ¸é±ð²Ô¨¦,
Am 07.01.2021 um 07:17 schrieb Rene BRANDT via groups.io <rbr146@...>: when the S is used in the definition of a zone e.g. S999, at hexadecimal level the sign will be on the left digit of the last byte: e.g. F1F2F3 will give F1F2C3 (12C) if the zone contains a positive value of +123 and F1F2D3 (12L) if the value is -123. For the value zero the value will be C0 on the last byte for a positive value and will be represented by the sign { and D0 for a negative value and represented by the sign } when displaying the field.Thanks for confirming and specifying more precisely my thoughts about the origins of the curly braces! :wq! PoC |
Re: COBOL in TK4-: Handling Signed Numbers
Yep, it abended?because I forgot something. A PIC X field is always left-justified. So, delete the filler, it is not necessary. Joe On Thu, Jan 7, 2021 at 3:42 AM Patrik Schindler <poc@...> wrote: Hello Joe, |
Re: COBOL in TK4-: Handling Signed Numbers
Hello Jay,
Am 06.01.2021 um 23:37 schrieb Jay Moseley <JayMoseley@...>: As others have said, the MVT COBOL compiler we have does not implement much in the way of sign handling for fields.I understand. But ?not much¡° is more than ?nothing¡°, I suppose. And so far, I was not able to get a grip on what¡¯s going on. A very long time ago I wrote some field pre/post processing routines for use with COBOL/CICS programs. One of these may help you with identifying the leading sign and converting the field to a packed field: jaymoseley.com/hercules/misc_pgms/miscpgms.htmThank you. Honestly, this wold open another pandora¡¯s box, so for now I¡¯ll put that aside. :wq! PoC |
Re: COBOL in TK4-: Handling Signed Numbers
Hello Joe,
Am 06.01.2021 um 22:50 schrieb Joe Monk <joemonk64@...>: "77 SCORE PIC S9(6)V99I did, as written. Now let me show you a trick:Q: Why do you use XX in the filler, instead of ?only¡° one? Compiles fine, run abends. 10.33.13 JOB 1016 IEF403I RUNSTATS - STARTED - TIME=10.33.13 10.33.13 JOB 1016 IEF450I RUNSTATS EXECSTAT - ABEND S0C7 U0000 - TIME=10.33.13 10.33.13 JOB 1016 IEFACTRT - Stepname Procstep Program Retcode 10.33.13 JOB 1016 RUNSTATS EXECSTAT SSTATS AB S0C7 10.33.13 JOB 1016 IEF404I RUNSTATS - ENDED - TIME=10.33.13 If I comment the MOVE, it runs. Current example input record(s), a little rearranged since I backed out my constant-width changes: 1 10 20 30 40 50 +---+----+----+----+----+----+----+----+----+¡ª¡ª+ Jan 7 10:02:29 052.20 3.0 823 Jan 7 10:09:45 023.00 3.2 21572 Jan 7 10:10:50 002.90 3.8 31572 Jan 7 10:12:27 -015.40 4.1 89374 Current file code: FD INPILE-FILE LABEL RECORD IS STANDARD RECORD CONTAINS 80 CHARACTERS BLOCK CONTAINS 0 RECORDS. 01 STATISTICS-INPILE-FORMAT. 02 MONTHNAME PIC A(3). 02 FILLER PIC X. 02 DAY-OF-MONTH PIC 9(2). 02 FILLER PIC X. 02 TIMESPEC. 03 T-HOUR PIC 9(2). 03 FILLER PIC X. 03 T-MINUTE PIC 9(2). 03 FILLER PIC X. 03 T-SECOND PIC 9(2). 03 FILLER PIC XX. 02 SCORE-TXT PIC X(7). 02 SCORE-NUM-R REDEFINES SCORE-TXT. 03 FILLER PIC XX. 03 SCORE-NUM PIC S9(3)V99. 02 FILLER PIC X. 02 SCANTIME PIC X(7). 02 FILLER PIC X. 02 BYTES PIC X(12). 02 FILLER PIC X(35). Current example output (without the move, that is): 20-Entry from Jan, 7, 10h 02m 29s: has 823 B, and took 3.0 s to scan. Score is 000000000 20-Entry from Jan, 7, 10h 09m 45s: has 21572 B, and took 3.2 s to scan. Score is 000000000 20-Entry from Jan, 7, 10h 10m 50s: has 31572 B, and took 3.8 s to scan. Score is 000000000 20-Entry from Jan, 7, 10h 12m 27s: has 89374 B, and took 4.1 s to scan. Score is 000000000 Recompile/run again with outputting SCORE-TXT: 20-Entry from Jan, 7, 10h 02m 29s: has 823 B, and took 3.0 s to scan. Score is 052.20 20-Entry from Jan, 7, 10h 09m 45s: has 21572 B, and took 3.2 s to scan. Score is 023.00 20-Entry from Jan, 7, 10h 10m 50s: has 31572 B, and took 3.8 s to scan. Score is 002.90 20-Entry from Jan, 7, 10h 12m 27s: has 89374 B, and took 4.1 s to scan. Score is -015.40 So, the general field parsing apparently is still valid. I really struggle to believe that a Business Language can¡¯t cope with signs, no matter how old. But obviously, I¡¯m missing something. May I ask for another nudge? :wq! PoC |
Re: REVIEW/RFE profile management change proposal
On Tue, 5 Jan 2021, Vince Coen wrote:
As Linux x3270 has no response when connecting with Y::wotho4.ethz.ch:3270 Just retried using windows Vista nt3270As Juergen suggested, the command x3270 L:wotho4.ethz.ch:3270 is working nicely under my Gentoo/Linux, from my network. Peppe. |
Re: COBOL in TK4-: Handling Signed Numbers
when the S is used in the definition of a zone e.g. S999, at hexadecimal level the sign will be on the left digit of the last byte: e.g. F1F2F3 will give F1F2C3 (12C) if the zone contains a positive value of +123 and F1F2D3 (12L) if the value is -123. For the value zero the value will be C0 on the last byte for a positive value and will be represented by the sign { and D0 for a negative value and represented by the sign } when displaying the field.
HTH ¸é±ð²Ô¨¦ |
Re: COBOL in TK4-: Handling Signed Numbers
Do your computations with pure numbers. Binary Comp -1 is fastest,
toggle quoted message
Show quoted text
Packed Decimal Comp-3 is slower, Zoned Decimal Display is slowest, not sure about Floating Point (Comp-2?). When you want to view the data, move the number to a Display number with appropriate edit masks (Z/9, $, signs, commas, decimal points) then display the print record containing the display number. On Wed, Jan 6, 2021 at 2:33 PM Patrik Schindler <poc@...> wrote:
--
Mike A Schwab, Springfield IL USA Where do Forest Rangers go to get away from it all? |
Re: COBOL in TK4-: Handling Signed Numbers
it is still not necessary to do any conversions ?on numbers from zoned decimal to use them in arithmetic in cobol. You can, but its not necessary. joe On Wed, Jan 6, 2021 at 5:36 PM Vince Coen <vbcoen@...> wrote: On 06/01/2021 23:11, cjar1950 via wrote: |
Re: COBOL in TK4-: Handling Signed Numbers
On 06/01/2021 23:11, cjar1950 via groups.io wrote:
Mark et al, Just had a look at my Cobol cross referencing program that work with ANSI Cobol as found in MVS 3.8J as in Turnkey-4. That uses comp?? with sign i.e., PIC S9(6)? COMP. If you want to look at it you can find it at : and the archive file is? MVS3.8J-cobxref.zip Contained within is : ?Length?? Method??? Size? Cmpr??? Date??? Time?? CRC-32?? Name --------? ------? ------- ---- ---------- ----- --------? ---- ???? 803? Defl:X????? 450? 44% 2015-12-23 18:28 1098e122 compile-cobxref.jcl ?? 63188? Defl:X??? 15780? 75% 2015-12-23 18:34 cbc20304 mak-xref-pds-0.37.jcl ??? 2126? Defl:X???? 1104? 48% 2015-12-23 19:27 8983b122? Read.me ??? 1140? Defl:X????? 420? 63% 2015-12-23 18:31 1d9bd66f run-cobxref.jcl --------????????? -------? ---??????????????????????????? ------- ?? 67257??????????? 17754? 74%??????????????????????????? 4 files The one you want is mak-xref-pds-0.37.jcl It is the source code along with the required JCL (MVS 3.8J). If you wish to use it you need to change lines 1 & 3 as well as the DSN statements in lines 5,10,11? to match your user name etc, i.e., :- //JCL001??? JOB (VBC001),VBCOEN, //* change next line to match your needs //???????????? USER=VBCOEN,PASSWORD=password, //???????????? CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1),REGION=64K /*JOBPARM ROOM=1001 //PDSCREAT EXEC PGM=IEBUPDTE //* ,PARM=NEW //SYSPRINT DD SYSOUT=A //*? change next 2 lines to match your needs //SYSUT1?? DD DSN=VBCOEN.TEST.COBOL,DISP=SHR //SYSUT2?? DD DSN=VBCOEN.TEST.COBOL,DISP=SHR //**??????????? DISP=(NEW,KEEP,CATLG), //*??????????? DISP=(,CATLG), //*??????????? UNIT=3350, //*??????????? SPACE=(CYL,(1,5,10)), //*??????????? DCB=(RECFM=FB,LRECL=80,BLKSIZE=19040) //* //*? use next 2 ./ lines 1st time run and omit the two after //*? //SYSIN? DD * //* //*./ ADD NAME=COBXREF,SEQFLD=016,LIST=ALL //*./ NUMBER NEW1=100,INCR=100 //SYSIN??? DD * ./ REPL NAME=COBXREF,LIST=ALL,SEQFLD=016 ./ NUMBER NEW1=100,INCR=100 . The above JCL hopefully is easy to understand. Vince Started IBM 1961 (1401 and 7094), then 360, ICL 1900, IBM 370, ICL 29/39 series developing VME and dump cracking) and COBOL systems for various ICL customers etc. The above program is the only one I have on my systems that is not source restricted. |