Application of railcards

91 views
Skip to first unread message

Linus Norton

unread,
Sep 7, 2016, 12:04:54 PM9/7/16
to A gathering place for the Open Rail Data community
Hi everyone,

Sorry, another couple of fares questions...

My understanding is that some ticket type codes cannot have a railcard applied to them (e.g. FOS or FOR tickets). I originally thought that there would be something in the fares feed to indicate whether a ticket type could have a railcard applied to it but I haven't found anything. My next instinct was that the ticket type discount category would not have a corresponding status discount for any railcard status. Looking at the data FOS has a discount category of "01" which has some corresponding records for status code "003" (YNG railcard). I might be wrong but I didn't think YNG railcards could be applied to first class tickets. My question is how can I know what railcards can be applied to what ticket types?

In what circumstances would you use a non standard discount as opposed to a non-derivable fare? I thought a NDF was basically used to manually set a fare price when applying a railcard. Non-standard discounts seem complex in comparison and I of thought the same thing could be achieved using NDFs.

Thanks again,

Linus


Linus Norton

unread,
Sep 9, 2016, 6:00:19 AM9/9/16
to A gathering place for the Open Rail Data community
As a follow on from this...

I can see that the non standard discount use nlc field is redundant (also noted here - https://sourceforge.net/p/librailfare/code/HEAD/tree/trunk/nfmcd/ns_discount.c#l176) ... if that is the case why do you increase the price of the fare using the add on value to calculate the discount price. I must be missing something.

Also, for other people silly enough to get into all this mess I've created a wiki guide to calculating fares - https://github.com/linusnorton/fares-service/wiki/Calculating-UK-Rail-Fares

I'll update it as I learn more.

Paul Kelly

unread,
Sep 9, 2016, 6:40:23 AM9/9/16
to openrail...@googlegroups.com
Hi Linus,
Sorry for not replying; I must have missed your other message. This is
very complicated stuff and I wouldn't 100% trust the public version of
the librailfare code on what it does here; my understanding of how this
all works has gradually evolved over the years and still occasionally
tweaks are needed.

On 09/09/2016 11:00 AM, Linus Norton wrote:
> As a follow on from this...
>
> I can see that the non standard discount use nlc field is redundant
> (also noted here -
> https://sourceforge.net/p/librailfare/code/HEAD/tree/trunk/nfmcd/ns_discount.c#l176)
> ... if that is the case why do you increase the price of the fare using
> the add on value to calculate the discount price. I must be missing
> something.

I haven't read that code again recently but as I said above please tread
carefully; it may be wrong. For some fares you do need to add on the
value shown - it compensates for the fact that a railcard or child
discount may only be available on the National Rail part of the journey
but not on the add-on part (e.g. inclusive admission to an attraction,
or travel by ferry, bus etc.).

> My understanding is that some ticket type codes cannot have a
> railcard applied to them (e.g. FOS or FOR tickets). I originally
> thought that there would be something in the fares feed to indicate
> whether a ticket type could have a railcard applied to it but I
> haven't found anything. My next instinct was that the ticket type
> discount category would not have a corresponding status discount for
> any railcard status. Looking at the data FOS has a discount category
> of "01" which has some corresponding records for status code "003"
> (YNG railcard). I might be wrong but I didn't think YNG railcards
> could be applied to first class tickets. My question is how can I
> know what railcards can be applied to what ticket types?

It sounds very much to me that you have got the general principle right
here. You maybe just need to look at how the discount category and the
status discount records interact, and check you've got that right. Two
interesting railcard codes to try for this are D34 and D50, which are
available for passengers travelling in a wheelchair who need to remain
in it for the journey. They can sometimes offer a better discount than a
disabled railcard but the list of fares they apply to is esoteric. Some
of the local railcards (Highland comes to mind, possibly also Cambrian
or Cotswold) offer unusual discount percentages across different ticket
types.

> In what circumstances would you use a non standard discount as
> opposed to a non-derivable fare? I thought a NDF was basically used
> to manually set a fare price when applying a railcard. Non-standard
> discounts seem complex in comparison and I of thought the same thing
> could be achieved using NDFs.

It's hard to know when non-standard discount records should be applied.
There is a flag in the flow record that says when they should be, but
then there are records in the non-standard discounts file that clearly
are intended to be used (some Manchester Metrolink fares, for example,
which are very restrictive about the railcard discounts they allow) but
the relevant flows don't have the flag set. It's all just a big mess,
really.

Interesting also what you said about the missing manual. I suspect there
is some "green screen" mainframe interface somewhere that contains the
definitive logic for how the records are supposed to interact, but that
nobody has ever extracted it and documented it. My understanding is that
all the data files in the fares feed (with the possible exception of the
NFO file) are extracted from the mainframe system - but it's then left
up to each ticket system supplier to define their own logic for how to
interpret the data!

Paul

Linus Norton

unread,
Sep 9, 2016, 8:59:56 AM9/9/16
to A gathering place for the Open Rail Data community
Thanks Paul, I'll re-check the way I'm matching up the discount categories

Linus Norton

unread,
Sep 9, 2016, 3:12:06 PM9/9/16
to A gathering place for the Open Rail Data community
It looks like the the discount a categories are matching up correctly but I need to take into account the restrictions for railcards. I was hoping to avoid restrictions until it came to validating the fare against a journey... guess not!
Reply all
Reply to author
Forward
0 new messages