about Accept statement accept number



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Re: about Accept statement accept number

Postby Pumpkin » Thu Mar 31, 2011 5:01 pm

Can we still make it S0C7 without a re-compile? Yes, that still stands. That is another hint. The "sign fixing" will not save the program.

It will help if you can look at EBCDIC codes for characters on your keyboard.

There is more than one character that will cause the abend. Think about what you already found out with the "-", but don't think like that one.



i think , enter "+" (hex 4E)or "." (hex 4B), it will the abend.
and i found the information about compiler directive in Programming Guide,thanks,Robert!
-------------------
Pumpkin
Pumpkin
 
Posts: 55
Joined: Sat Mar 05, 2011 9:12 am
Has thanked: 0 time
Been thanked: 0 time

Re: about Accept statement accept number

Postby BillyBoyo » Thu Mar 31, 2011 5:18 pm

Absolutely correct. Anything that has a non-numeric right half-byte, and you can enter it from the keyboard, will cause an S0C7 after you've done your ACCEPT.

Any questions?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: about Accept statement accept number

Postby BillyBoyo » Fri Apr 01, 2011 3:04 am

BillyBoyo wrote:I haven't checked this againt the generated code. I suppose I should


And of course I should have done. Turns out I was thinking of Pumpkin's first program. The only difference for the purpose of my post is that the first one uses COMPUTE, which led to my comment about the length of intermediate values. These get large in a COMPUTE where there is multiplication (not in Pumpkin's first program). So I needn't have mentioned it anyway.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: about Accept statement accept number

Postby Pumpkin » Fri Apr 01, 2011 5:42 pm

thanks, BillyBobo!
-------------------
Pumpkin
Pumpkin
 
Posts: 55
Joined: Sat Mar 05, 2011 9:12 am
Has thanked: 0 time
Been thanked: 0 time

Previous

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post