Month: November 2017

My first COBOL program.

November 9, 2017 Mainframe No comments , , , , ,

I recently bought Murach’s COBOL reference:

and coded the chapter 1 compound interest calculation myself before looking at the solution.  I was surprised to see that (n)vim has built in syntax highlighting for COBOL.  It even helps position the comments and line starts in the right places, which was handy.

Having been horrified any time in the past that I saw COBOL code, it feels weird to be coding my own hello-world in the language, but it works, and with ALL CAPS output, it looks sufficiently dinosaur’ish to be COBOL:

./interest 
-----------------------------------------------
TO END PROGRAM, ENTER 0.
ENTER THE INVESTMENT AMOUNT.
1000
ENTER THE NUMBER OF YEARS.
1
ENTER THE INTEREST-RATE.
1
FUTURE-VALUE = 0001010.00
-----------------------------------------------
TO END PROGRAM, ENTER 0.
ENTER THE INVESTMENT AMOUNT.
1000
ENTER THE NUMBER OF YEARS.
2
ENTER THE INTEREST-RATE.
1
FUTURE-VALUE = 0001020.10
-----------------------------------------------
TO END PROGRAM, ENTER 0.
ENTER THE INVESTMENT AMOUNT.
0
END OF SESSION.

Notes and questions:

  • I wasn’t sure about when I had to use statement terminators (.’s) in the ELSE body, so I moved the whole basic block to a helper function.
  • I got messed up initially with the syntax for the PIC values at first, as I’d used .’s instead of V’s to specify that my variables were numeric.  This caused cobc (gnu-cobol front end) to complain that INTEREST-AMOUNT was not numeric, and I eventually found the answer in the PIC table of the book.
  • The point of this exercise was probably to use a loop, which I avoided by calculating the value in one shot.  I’ll have to go back and see how to do that.
  • There doesn’t seem to be any notion of function prototype, and the function bodies can be either before or after their calls.
  • Functions are annoyingly, but appropriately (given the requirement to be over the top verbose for many things), called PARAGRAPHs in COBOL.  I wonder what the mainframe does with name mangling, given that symbol names have to be 8 characters, and COBOL function names are up to 30.  Perhaps only the external entry points (the program-id?), have that restriction?
  • cobc’s implementation of -g sucks, and a debug session shows the lines of the generated .c files instead of the COBOL sources.  There ought to at least be #line markers in the generated C sources instead of comments.

Failed purchases at overstock.com (trying to spend bitcoin)

November 5, 2017 Bitcoin, Incoherent ramblings No comments , , , , , , , ,

A couple years ago I bought a few bitcoin at fairly low rates compared to the current price, and thought I’d try to recoup my initial “investment” by spending some of it (since selling it back for money on an exchange appears to require a capital gains tax report in Canada).  Such purchases are easier said than done, at least here in Canada.

I found that Newegg advertises themselves as bitcoin capable, but it turns out that this is not offered for newegg.ca, and newegg.com restricts payment with bitcoin to certain types of purchases (and it seems like used phones on their marketplace do not qualify).  I found coincards.ca, but was not impressed by how much mark up they impose on every purchase (5%).  Despite Coincards calling this a “convenience fee”, I don’t feel that having to eat a 5% fee for every purchase is very convenient.

Before looking at Coincards and Newegg I had tried overstock.com as I knew from the Tom Woods show that the founder was enthusiastic about bitcoin.  The idea behind this company is that they buy excess stock from vendors and can then offer the items for less.  Some browsing of the prices on this site leave me unconvinced.  I think the savings are passed on to the company and very little to the consumer, however, they accept bitcoin, so I thought “what the hell” and did a (fairly sizeable) test purchase.

This didn’t work out very well.  Either because of current bitcoin network latencies, or perhaps due to the fees added by the wallet that I used, my transaction timed out after “network fee may have been too low message” after I had submitted my payment to the Coinbase dialog that came up in the Overstock cart checkout.  The transaction had been submitted from my wallet to the bitcoin network, but Coinbase tells me the transaction is timed out, and I’m left with the item still in my card, unpaid.

Basically, my payment was stuck in limbo.  Overstock has an online chat support option, which is very responsive, but the support rep I got just played pass the buck:

Bishop: Hi, my name is Bishop. How may I help you?
peeter.joot: I attempted to make a purchase with bitcoin, and got a message saying that the mining fee may have been too small.  I see the transaction processed from my wallet (with two confirmations so far), but the coinbase transaction window claims the transaction expired.
Bishop: Hello there.
peeter.joot: it presented me with a window to return to overstock.com, and there’s no sign of my transaction there in my cart.
Bishop: I’ll be glad to check and help you with this information.
Bishop: In this situation I recommend you to contact  Coinbase, please visit support.coinbase.com or, email support@coinbase.com. for further help.
Bishop: I know I have not resolved the issue for now and have only shared a best possible recommendation, but was I able to address your concerns for now?
Bishop: I don’t mean to rush you, however our chat will time out in the next one minute; please respond so that we can stay connected.
Bishop:
Thank you for contacting Overstock. Before you go, we invite you to check out the exclusive benefits of becoming a Club O Member. Club O allows you to earn rewards and save more with every Overstock.com purchase. It’s our way of saying ‘Thank You’ for shopping with us. Click  here to learn more!
Bishop has disconnected.
The email address for Coinbase that Bishop gave me bounced, but did at least point me to the Coinbase support forum.  This got me a response:

Hi and thanks for contacting Coinbase Support.

I was able to locate the order details using the info provided. I see that you have paid for an order, but it was marked as Expired. Overstock has been paid for it, if you send the below info to Overstock, they should be able to locate your order to fulfill or refund it as desired.

https://www.coinbase.com/orders/XN0KMJGU

Order Code: XN0KMJGU
Created: 2017-09-30 6:29 AM
Merchant: Overstock.com
Order Status: Expired Confirmed Has mispayments
Address: …
Order Amount (BTC): … BTC
Order Amount (Native): … USD
Custom Parameter: 200882508
Button: … on Overstock.com invoice ID 200882508.

If you have any further questions, please let us know.

Randy
Coinbase Support
I provided this info to one of the Overstock support reps, who kept telling me that there wasn’t anything that he could do, and that I had to contact Coinbase for support, despite the fact that I’d just given him the info that Coinbase just provided me.  I was honestly convinced that this support rep was a robot, because he wasn’t capable of understanding even the simplest things.  After he claimed that he wasn’t a robot (unconvincingly) I asked to talk to a manager, and he said he’d have a specialist deal with the issue.
Eventually, I got a response from somebody in the payments department:
By Caroline S. on 10/05/2017 08:55 AM

Hello ,

I’m writing today in response to your recent contact about your Bitcoin order XN0KMJGU . I am happy to help you today.

So when we see the expired tab , it indicates that the system had timed out and the funds did not come through . I can issue the refund back through Coinbase . We will need to refund $… USD so you could try and place the order again . I tried to refund to your wallet address that you provided in the chat but it would not take that address . Do you have an e-mail that we could refund to ?

Please let me know if there is anything else I can do for you with this or any other issue. Visit us again soon for great savings on our name-brand products.

I am so sorry that the order did not process through and appreciate your patience while we work through this issue.

Please respond back to this e-mail .

Sincerely,

Caroline S.
Pay Support

I was severely unimpressed that they weren’t able to simply finalize the transaction I’d attempted, but instead had to refund the bitcoin, so that I could try again.  They had some trouble doing so since I did not use a Coinbase wallet for my payment, but a private wallet.  In the end, I resurrected the Coinbase wallet I had once created (but hadn’t used), and they sent the refund there successfully.
After this hassle I gave up on the item I originally tried to purchase, but thought I’d try Overstock one more time, but this time used my Coinbase wallet with the Overstock Coinbase dialogue.  My hope was that Coinbase would know the transaction was submitted, even if the bitcoin network confirmations hadn’t occurred, and treat it as paid despite the network.
For my second purchase attempt I ordered a refurbished unlocked phone for my wife, and a bench grinder for myself.  The phone came within a couple days (left unattended on my doorstep by the courier!), and the grinder arrived by Canada Post in about a week.
After the adventure of cutting and sanding my wife’s microsim to nanosim size (you can find instructions for this on youtube, but make sure to download the letter size template, not A4, and print it in actual size, not the default), we discovered the hard way that Overstock had sent a phone that was locked to AT&T, and it even listed the phone on the packing slip at an “ATT” phone and not unlocked.  This made the phone unless as it wasn’t even possible to get past the SIM setup screen to the settings nor the home screen.  I had to contact Overstock four times (three using the contact form, and finally once more with their phone number).  I’d been promised call backs twice (1-2 business days), and those never materialized.  The last support person I dealt with (Nora) was helpful, and told me that if I could get the phone unlocked manually for <= $50 they’d refund me that amount.  Unfortunately, after a trip to the mall to the little shop that unlocked my android phone, I was told that they couldn’t unlock this type of phone locked to AT&T, and told me that I’d probably be charged at least $140 Canadian for somebody that could do.  That price was consistent with the unlocking fee on unlockriver.com, which was $110 USD, so I gave up on getting it unlocked myself.
Because the phone that I’d ordered was out of stock on Overstock by the time we discovered it was locked, they weren’t able to send me a properly unlocked replacement of the same type.  I should have asked for an upgrade to the next most similar model since the combined time that my wife and I spent with customer support and playing with the phone and with the Canadian phone carriers was horrendous, and probably added up to hundreds of dollars of time equivalent to salary.
Instead I was sent a packing slip to return the phone:

Thank you for contacting Overstock.com.

We believe that we have resolved your inquiry. However, if it has not been answered to your satisfaction, you may reopen it within the next 7 days.

By Nora A. on 11/03/2017 01:49 PM

Hello Peeter,

We’re sorry to hear that you need to return your … (Refurbished) because it arrive and it is locked with ATT. We recognize that returning an item can be inconvenient, and we want to make this process as easy as possible.

We will return this item at no cost to you. Please print the return shipping label attached to this email. If you cannot open the PDF file, visit http://get.adobe.com/reader to download a free Adobe PDF reader. If you still cannot access or print the label, please email us at international@overstock.com or call us at 00-1-(919)576-9926.

Once the label is printed, please use the following steps to return your item:

1. Print the label and affix it to the package.
2. Write the Return Merchandise Authorization(RMA) number … on the outside of the package large enough for it to easily be seen.
3. Take the package to your nearest Canada Post office.

It may take 5-7 business days after we receive your return to issue your refund. We will send you an email notification once we complete your return.

Thank you for your patience through this return process. If you have any other questions on this or any other issue, please reply to this email or call us at 00-1-919-576-9926.

You may also view our full Standard Return Policy by visiting this link: https://help.overstock.com/app/answers/detail/a_id/1

Sincerely,

Nora A.
Overstock Global Solutions Specialist

So, once again, my attempt to purchase something on Overstock has left me without the item, and a requirement to return it, and retry the transaction again should I desire.  I don’t think there’s much chance in hell that I’ll try such a purchase on Overstock again.  A 1/3 success rate just doesn’t inspire confidence, and their prices aren’t that great to start with.