HP3000-L Archives

March 2002, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Richard Barker <[log in to unmask]>
Reply To:
Richard Barker <[log in to unmask]>
Date:
Wed, 6 Mar 2002 10:24:12 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (87 lines)
Not knowing Cobol that well, wouldn't the display show the other character
if it is in the variable, so when I'm displaying "'"card-type"'" and the
program displays '@', shouldn't it show something else.



-----Original Message-----
From: Steve Miller [mailto:[log in to unmask]]
Sent: Tuesday 05 March 2002 17:54
To: Richard Barker; [log in to unmask]
Subject: Re: Re: Cobol help - EVEN STRANGER


Richard,

If you are not initializing 'card-type' before doing an ACCEPT, it is
possible your second character will have garbage in it when only entering
one character.  I have found that ACCEPT will only populate the number of
characters entered in the field.  For example, you have a two byte field,
but only enter one byte - @.  The second byte of card-type remains
unchanged.  Now, you make a comparison of the constant "@" (or technically
"@ " padded with a space) with "@?" (? being some bit pattern but most
likely not space).  That will fail, of course.

Try adding a VALUE SPACES to your field definition (or MOVE SPACES TO
card-type before your ACCEPT).  Why this worked before with no changes I
can't say, but I always make it a habit to initialize any ACCEPT fields,
having been burned before.

Steve Miller
Beechglen Development, Inc.
Cincinnati, Ohio

----- Original Message -----
From: "Richard Barker" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Tuesday, March 05, 2002 11:27 AM
Subject: Re: Cobol help - EVEN STRANGER


> I think a new emergency patch we applied must be causing lots of Cobol
> problems, or I am going mad:
>
> card-type pic XX.
>
> if pay-payment-batch = "PENDING"
>     DISPLAY "pay-payment-code" pay-payment-code
>     DISPLAY "Card type" "'"card-type"'"
>  if pay-payment-code = card-type or card-type = "@"
>   display "true"
>   display "Post " pay-rec-loc-line " " pay-payment-code " "
>            pay-payment-text " " pay-payment-batch " "
>            pay-payment-time
>   move payments to ccardin-rec
>   write ccardin-rec
>  end-if
> end-if
>
> When I run this:
>
> Enter card type: @
>
>
> pay-payment-codeVI
> Card type'@'
> pay-payment-codeVI
> Card type'@'
> pay-payment-codeDI
> Card type'@'
>
> etc....
>
> The program hasn't been changed for over a year and always worked, if I
> change the logic to:
>
>  if pay-payment-code = card-type or card-type = "XX"
>
> Enter card type: XX
>
> It works.
>
> * To join/leave the list, search archives, change list settings, *
> * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2