ACCORDING TO the song, New York's 42nd Street is "naughty, bawdy, gaudy, haughty"; according to clean-up-minded citizens groups it's a too-visible mecca for lowlife. But for urban sociologists 42nd Street and its environs provide a rich lode to mine and, observing this wealth, Alix Kates Shulman has absorbed the spill-over and used it to produce a novel that beams compassion into the dark places behind the neon.

The world of On the Stroll is far removed from the luxuries of middle-class self-examination that dominated Shulman's previous two books, Memoirs of an Ex-Prom Queen and Burning Questions. Desire for freedom is the driving force here, whether from a tyrannical father, from painful memories or from the straight world of 9-to-5 nowhere jobs. And surviving is the measure of success: for Robin, the runaway teenager-turned-hooker; for Owl, the bag lady, and for Prince, the young pimp.

Coming off the bus from Maine, 16-year-old Robin knows deep down that "never never never would she go back." She has left behind a viciously tyrannical father and a beaten- down mother, and, along with her backpack, she carries with her an enormous confidence in her ability to make her own picaresque way. However, for all of her practiced guile, Robin is a Red Riding Hood ripe for a wolf, a country mouse unfamiliar with city traps, and, when she hears the driver announce "Port Authority. . . . she knew enough to heed it. You didn't argue with authority."

Just the type of girl that keeps Prince hanging out in the bus terminal, waiting to pounce on likely prospects. Half-white, half-Filipino, Prince is a vain but agreeable pimp who likes to play by the rules, and when he snares Robin it's clear that he wishes her no ill, only wants her to succeed "on the stroll." As a prostitute Robin is a visible symbol of Prince's manhood and an income-earning satellite to his ego, but he thinks she gets a lot in return.

"He called her his lady, slipped spending money into her pocket, dressed her, fed her, bought her anything she wanted, took her hand when he walked beside her as if he was proud. He thought about her life, her future . . . he was even putting money in a joint bank account for them." But, for Robin, it's all happened so quickly; docile for the time being, she's simply biding her time. Mesmerized by Prince's careful handling of her, trapped like a fly on the sticky flypaper of the loving security he offers, Robin doesn't really mind the discipline: it's, in fact, reassuring. Yet, though Prince can't sense it and thinks she has "the makings of a first-class ho," Robin is poised for flight once again.

Another sort of runaway is Owl, a shopping- bag lady who, since she carries the remains of her life with her (in sacks named Ellen, Belle, Susan, Barbara and Misc. Gloria), has made flight into permanence. Owl is fat and bewigged, with swollen, suppurating legs and a missing tooth, but she was once a beautiful young woman who'd spent World War II being wined and dined and made love to by the American military in Europe. Her memories are not all of the caf,es along the Via Veneto, though, for her second marriage ended in betrayal and divorce, with Owl eventually institutionalized and her beloved daughter, Milly, taken away from her by her ex-husband.

It is this that haunts her--love turned to betrayal, resulting in chaos--and, as their paths around Times Square intersect, Owl sees in Robin a reincarnation of the long-lost Milly. Whereas Prince, running away too, from a wife and child desirous of being supported in the conventional manner, sees Robin as a meal- ticket if he plays his cards right, Owl sees her as a kind of salvation.

Shulman takes this trio and works hard at getting under their skins, not judging them, not moralizing, but looking out at events with them. In an odd way, there's an element of fairy tale to On the Stroll, despite its grotty realism (overflowing trash cans, decomposing birds, fallen-down buildings and winos dot the landscape). Shulman gives us these characters and it's certainly possible to believe in them, but Robin is Red Riding Hood, Sleeping Beauty and the clever simpleton all rolled into one. Prince is indeed predatory but he's a lamb wearing wolf's clothing while Owl is both a fairy godmother and the beautiful princess forced to wear a crone's guise. Is life like this?

Yes. Everyone, whether taking a simple or complex part, plays these roles and others, if not on 42nd Street, where fairy tales turn lurid, then in some tidier, less bawdy, gaudy place. So Shulman plugs into myth to give us a contemporary fable of people on the outside and her empathy sustains the book throughout. Another fairy-taleish aspect to On the Stroll is the way that Prince, Robin and Owl can all be viewed as bogeymen by the people on the inside.

Shulman rightly makes Owl the book's most complicated figure and wants us to be inside Owl with her, even when it's a little claustrophobic. Without having Owl introduced to us by her creator, without being forced to learn the rhythm of her alternating grievances and pleasure-filled reveries, it's certain that were we to come across her on the street we would avert our eyes and step to the other side of the sidewalk.

Shulman, whose gushy earnestness made parts of her earlier books heavy going, here makes an unlikely set of ingredients highly palatable. Armed with a familiarity with street jargon and pimps' cant, she sometimes achieves an almost Dickensian sense of society's underside. On the Stroll is an unexpected book, and a worthy one. $90By MICHELE SLUNG; MICHELE SLUNG writes the "Book Report" column for Book World.