LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 1998, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 19 Jun 1998 08:51:24 -0700
Reply-To:   Tim Correia <Tim.Correia@NCAL.KAIPERM.ORG>
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   Tim Correia <Tim.Correia@NCAL.KAIPERM.ORG>
Subject:   Re: MVS/EBCDIC SAS question, unsigned packed format?
Comments:   To: Return requested <thomas.hanan@PRUDENTIAL.COM>
Comments:   cc: Return requested <pdorfma@UCS.ATT.COM>

Thomas, I had the same problem just last week. But in my case I was both the SAS programmer and the Cobol programmer. I contacted the SAS Institute and found out about several formats that I wasn't aware of. The S370FPDw. (packed decimal unsigned) did just the trick, give it a try. Tim


Date: Thu, 18 Jun 1998 18:05:05 -0400 From: "Dorfman, Paul" <pdorfma@UCS.ATT.COM> Subject: Re: MVS/EBCDIC SAS question, unsigned packed format?

Thomas Hanan <thomas.hanan@PRUDENTIAL.COM>, in part, wrote:

>This question falls under the category "there's gotta be a format for >this". I've scanned my battered language manual and tech report P-222, and >unless I've just missed it somewhere, I can't find a format that does what >I want. What I'm looking for is a format that will create an unsigned >numeric value. For example, I want the numeric value 123456789 to show up >as (in hex): > >13579 >2468F > >The PDw. format sticks a sign on the last half-byte (or nibble, as the SAS >manual humorously refers to it) so the if I output this number as PD5., it >shows up as: > >13579 >2468C > >Not a big deal to me, but then again, I'm a SAS programmer, I can read >anything. The problem is, I'm creating this file for a COBOL programmer, >and she doesn't want the sign on there... So, what to do? I've come up >with the following (very ugly) code, which works, but I don't like it. >Please tell me that I just haven't read my documentation thoroughly and >that there's a handy-dandy format to produce the desired output.


Your code is not ugly, and yes, you can read anything, even this really ugly packed hexadecimal where low nibble has no meaning, with $PHEX5w.. But write it with a format can you not, to the best of my awareness. Maybe SI has decided that writing data this way doesn't make sense; I tend to agree with that. If I have an always positive numeric with even number of digits and want to save a byte, then PKw. will do it just fine. If the sign is significant, then PDw. will do the job. But why lose a byte and have nothing in return?

All that having been said, I'd still like to have something like PHEXw. just in case like yours, so that it would be easier to satisfy the needs of some Cobol folks insisting that the insane data representation be used merely because of being too lazy to change a copybook. And, of course, I'd be happy to find out that I'm wrong, that packed hexadecimal with trailing x'f' is quite important and necessary, and that a format to write it already exists.

Sorry it wasn't too much of a consolation...

Regards, Paul.

+++++++++++++++++++++++++++++++++++++ Paul M. Dorfman Citibank UCS Decision Support Systems Jacksonville, FL +++++++++++++++++++++++++++++++++++++

Back to: Top of message | Previous page | Main SAS-L page