DFSORT data formats - IBM

文章推薦指數: 80 %
投票人數:10人

The following are treated as negative sign indicators: D, B, 9, 7, 5, 3, 1. ... Y2U, Y2V, Y2X, Y2Y, Y4U, Y4V, Y4X, Y4Y, (packed decimal date format with ... DFSORTdataformats DFSORTsupportsalargenumberofdataformatsasdescribedbelow. DFSORT dataformatsFormat Description CH (characterEBCDIC,unsigned).Each characterisrepresentedbyits8-bitEBCDICcode.Example:AB7becomes C1      C2      F7        Hexadecimal 11000001  1100001011110111  Binary Note: IfCHALTisineffect,aformatCHfieldcollatesaccordingto theALTSEQ(alternatecollatingsequence)tableineffect.AQformat canbeusedforthesamepurpose. Iflocaleprocessingisineffect,aformatCHfieldcollates accordingtothecollatingrulesoftheactivelocale. UTF8 UnicodeTransformationFormat,an8-bitencodingformdesignedforeaseofusewithexisting ASCII-basedsystems.UTF-8canencodeanyoftheUnicodecharacters.AUTF-8characteris1,2,3, or4bytesinlength.AUTF-8datastringcancontainanycombinationofSBCSandMBCSdata, includingsupplementarycharacters. Character A Unicode U+0041 UTF-8(Halfbytesinhexadecimal) 01000001 41=>X'41' Character § Unicode U+00A7 UTF-8(Halfbytesinhexadecimal) 1100001010100111 C2A7=>X'C2A7' Character Unicode U+1156 UTF-8(Halfbytesinhexadecimal) 111000011000010110010110 E18596=>x'E18596' Note: RefertotheUnicodeCharacterCodeChartsforallthecodepointrepresentations. Whensorting/merging,aformatUTF8fieldcollatesaccordingtothecollatingversionoftheactiveCOLLKEY.UCA600isthedefaultcollationversion. UTF16 UnicodeTransformationFormat,a16-bitencodingformdesignedtoprovidecodevaluesforoveramillioncharacters.UTF-16canencodeanyoftheUnicodecharacters.InUTF-16encoding,charactersare2bytesinlength,exceptforsupplementarycharacters,whichtaketwo2bytestringunitspercharacter. Character A Unicode U+0041 UTF16(hexadecimal) 0000000001000001 0041=>X'0041' Character § Unicode U+00A7 UTF16(hexadecimal) 0000000010100111 00A7=>X'00A7' Character Unicode U+1156 UTF16(hexadecimal) 0001000101010110 1156=>x'1156' Note: RefertotheUnicodeCharacterCodeChartsforallthecodepointrepresentations. Whensorting/merging,aformatUTF16fieldcollatesaccordingtothecollatingversionoftheactiveCOLLKEY.UCA600isthedefaultcollationversion. UTF32 UnicodeTransformationFormat,a32-bitencodingformwithafixed-lengthencoding,incontrasttoallotherUnicodetransformationformats,whicharevariable-lengthencodings.Each32-bitvalueinUTF32representsoneUnicodecodepointandisexactlyequaltothatcodepoint'snumericalvalue. Character A Unicode U+0041 UTF32(hexadecimal) 000000000000000001000001 000041=>X'00000041' Character § Unicode U+00A7 UTF32(hexadecimal) 000000000000000010100111 0000A7=>X'00A7' Character Unicode U+1156 UTF32(hexadecimal) 00000000000000000001000101010110 00001156=>X'1156' Note: RefertotheUnicodeCharacterCodeChartsforallthecodepointrepresentations. Whensorting/merging,aformatUTF32fieldcollatesaccordingtothecollatingversionoftheactiveCOLLKEY.UCA600isthedefaultcollationversion. ZD (zoneddecimal,signed).Eachdigit ofthedecimalnumberisconvertedintoits8-bitEBCDICrepresentation. Thesignindicatorreplacesthefirstfourbitsoftheloworder byteofthenumber.Example:-247becomes 2        4        -7    Decimal F2      F4      D7    Hexadecimal 111100101111010011010111  Binary Thenumber+247becomes F2      F4        C7 111100101111010011000111 Note: Thefollowingaretreatedaspositivesignindicators:F,E,C, A,8,6,4,2,0. Thefollowingaretreatedasnegativesignindicators:D,B,9, 7,5,3,1. ForSUMprocessing,0through9forthesignorAthroughFfor adigitresultsinadataexception(0C7ABEND).Forexample, aZDvaluesuchas3.5(X'F34BF5')resultsinan0C7because Bistreatedasaninvaliddigit.ICETOOL'sDISPLAYorVERIFY operatorcanbeusedtoidentifyZDvalueswithinvaliddigits. ICETOOL'sVERIFYoperatorcanbeusedtoidentifyZDvalueswith invalidsigns. Thefirstfourbitsofthelastdigitisthesignindicator.The firstfourbitsofeachotherdigitisignored.ThustheEBCDIC strings'0025'and'  25'arebothtreatedas25because aleadingblank(X'40')isequivalenttoa0digit(X'F0'). PD (packeddecimal,signed).Eachdigit ofthedecimalnumberisconvertedintoits4-bitbinaryequivalent. Thesignindicatorisputintotherightmostfourbitsofthenumber.Example:-247becomes 2  4    7-    Decimal 2  4    7D    Hexadecimal 0010010001111101    Binary Thenumber+247becomes247Cinhexadecimal. Note: Thefollowingaretreatedaspositivesignindicators:F,E,C, A,8,6,4,2,0. Thefollowingaretreatedasnegativesignindicators:D,B,9, 7,5,3,1. ForSUMprocessing,0through9forthesignorAthroughFfor adigitresultsinadataexception(0C7ABEND).Forexample, aPDvaluesuchasX'0123BF'resultsinan0C7because Bistreatedasaninvaliddigit.ICETOOL'sDISPLAYorVERIFY operatorcanbeusedtoidentifyPDvalueswithinvaliddigits. ICETOOL'sVERIFYoperatorcanbeusedtoidentifyPDvalueswith invalidsigns. PD0 (packeddecimal,withsignandfirst digitignored)ThePD0formatcanberepresentedasfollows:xddd...dsxishexadecimal0-Fandisignored. dishexadecimal0-9andrepresentsadecimaldigit. sishexadecimal0-Fandisignored. PD0canbeusedfor partsofPDfields.Forexample,inthePDfieldP'mmddyy'(hexadecimal 0mmddyyC),PD0canbeusedseparatelyfor0mmd(mm),mddy(dd)and dyyC(yy). FI (fixed-point,signed). Thecompletenumberisrepresentedbyitsbinaryequivalentwiththe signindicatorplacedinthemostsignificantbitposition.0for +or1for-.Negativenumbersarein2'scomplementform.Example:+247becomesinhalfwordform 00F7Hexadecimal 0000000011110111Binary -247becomesinhalfwordform FF09Hexadecimal 1111111100001001Binary BI (binaryunsigned).Anybitpattern. FL (hexadecimalfloating-point, signed).Thespecifiednumberisinthetwo-partformatofcharacteristic andfractionwiththesignindicatorinbitposition0.Example:+247becomes 42F70000...Hexadecimal 01000010111101110000000.......Binary +chara.Fraction -247isidentical,exceptthatthesignbitischangedto1. C2F70000...Hexadecimal 11000010111101110000000.......Binary -chara.Fraction AQ (characterEBCDIC,withalternate collatingsequence,unsigned).ThisissimilartoformatCH,but thecharacterscollateaccordingtotheALTSEQ(alternatecollating sequence)tableineffect. AC (characterEBCDIC, withASCIIcollatingsequence,unsigned).Thisissimilartoformat CH,butthecharacterscollateaccordingtotheASCIIcollatingsequence. D1 (EFStype).User-defineddata type(requiresanEFSprogram) D2 (EFStype).User-defineddata type(requiresanEFSprogram) CSForFS (signednumericwithoptionalleading floatingsign).Thefloatingsignformatcanberepresentedas follows:d...d sisanoptionalsign immediatelytotheleftofthedigitsd...d.Ifsisa-, thenumberistreatedasnegative,otherwiseitistreatedaspositive. Thus,-mustbeusedforaminussign,butanyothercharacter (forexample,+orblank)canbeusedforaplussign.Thefirstnon-decimal digit(thatis,not0-9)goingfromrighttoleftistreatedasthe signandanythingtotheleftofthesignisignored.Examples: Value:Treatedas: 34+34 +34+34 00034+34 -003-3 --1234-1234 1234+1234 +01234+1234 0+0 Thetypesofdatahandledbythe CSForFSformatencompassthoseproducedbyseveraldifferentFORTRAN, PL/IandCOBOLformats,suchasthoseshownbelow(usingawidthof 4forpurposesofillustration):*FORTRAN:  I4;G4.0;SP,I4;SP,I4.3;S,I4.3 *PL/I:  F(4);P'S999';P'SSS9';P'---9' *COBOL:  PIC++9;PIC+999;PIC++++;PIC---9;PIC----;PICZZZZ UFF (unsignedfreeformnumeric).This formatextractsdecimaldigits(0-9)fromrighttoleftanywherein thefieldtoformapositivenumber.Anycombinationofcharacters isvalid,butcharactersotherthan0-9areignored. Examples:              Value:Treatedas: $58,272,300.10+5827230010 $58,272,300.1+582723001 $58,272,300+58272300 12-31-2004+12312004 (402)-125-3721XXX+4021253721 G1***52$21R+15221 000128637.240+128637240 +400.52+40052 +400.1+4001 173/821/9072/@3+17382190723 ABC+0 SFF (signedfreeformnumeric).This formatextractsdecimaldigits(0-9)fromrighttoleftanywherein thefieldtoformapositiveornegativenumber.If-or)isfound anywhereinthefield,thenumberistreatedasnegative,otherwise itistreatedaspositive.Anycombinationofcharactersisvalid, butcharactersotherthan0-9,-and)areignored. Examples:             Value:Treatedas: 358,272,300.10+35827230010 358,272,300.1+3582723001 -358,272,300-358272300 (82,316.90)-8231690 12-31-2004-12312004 G1***52$21R+15221 G1***)52$21R-15221 000128637.240+128637240 400.52--40052 ($400.5)-4005 173/821/9072/@3+17382190723 X,Y,Z+0 CSLorLS (signednumber,leadingseparate sign).Thisformatreferstodecimaldataaspunchedintocards,and thenassembledintoEBCDICcode.Example:+247punchedinacardbecomes +          2      4        7      Punchednumericdata 4E        F2      F4      F7    Hexadecimal 01001110  111100101111010011110111  BinaryEBCDICcode -247becomes -          2        4        7      Punchednumericdata 60        F2      F4      F7    Hexadecimal 01100000  1111001011110100  11110111  BinaryEBCDICcode Note:Avaluewith'-'astheleadingsigncharacteris treatedasanegativevalue.Avaluewithanyleadingsigncharacter otherthan'-'(forexample,'+'(plus)orblank)istreated asapositivevalue. CSTorTS (signednumeric,trailingseparate sign).ThishasthesamerepresentationastheCSLformat,except thatthesignindicatorispunchedafterthenumber.Example:247+punchedonthecardbecomes F2  F4  F7  4E  Hexadecimal Note:Avaluewith'-' asthetrailingsigncharacteristreatedasanegativevalue.A valuewithanytrailingsigncharacterotherthan'-'(forexample, '+'(plus)orblank)istreatedasapositivevalue. CLO1or OL1 (signednumeric,leadingoverpunch sign).Thisformatagainreferstodecimaldatapunchedintocards andthenassembledintoEBCDICcode.Thesignindicatoris,however, overpunchedwiththefirstdecimaldigitofthenumber.Example:+247with+overpunchedon2becomes +2      4        7      Punchednumericdata C2      F4      F7      Hexadecimal 110000101111010011110111  BinaryEBCDICcode Similarly-247becomes D2      F4      F7 CTOorOT (signednumeric,trailingoverpunch sign).ThisformathasthesamerepresentationasfortheCLOformat, exceptthatthesignindicatorisoverpunchedonthelastdecimal digitofthenumber.Example:+247with+overpunchedon7becomes F2F4C7hexadecimal ASL (signednumeric,ASCII,leadingseparate sign).SimilartotheCSLformatbutwithdecimaldataassembled intoASCIIcode.Example:+247punchedintocardbecomes +        2        4        7      Punchednumericdata 2B      32      34      37      Hexadecimal 0101011001100100011010000110111  BinaryASCIIcode Similarly-247becomes 2D323437hexadecimal Note:Avaluewith'-' astheleadingsigncharacteristreatedasanegativevalue.Avalue withanyleadingsigncharacterotherthan'-'(forexample, '+'(plus)orblank)istreatedasapositivevalue. AST (signednumeric,ASCII,trailing separatesign).ThisgivesthesamebitrepresentationastheASL format,exceptthatthesignispunchedafterthenumber.Example:247+becomes 3234372Bhexadecimal Note:Avaluewith'-' asthetrailingsigncharacteristreatedasanegativevalue.A valuewithanytrailingsigncharacterotherthan'-'(forexample, '+'(plus)orblank)istreatedasapositivevalue. Inthedateformatsbelow,unlessspecifiedotherwise, yyrepresentsthetwo-digityear(00-99),dddrepresentsthedayof theyear(001-366),ccyyrepresentsthefour-digityear,mmrepresents themonth(01-12),ddrepresentstheday(01-31),xrepresentsa decimaldigit(0-9),sishexadecimal0-Fandisignored,andcrepresents thecenturyindicator(c=0istransformedto19,c=1istransformed to20andc>1istransformedto21). In thedateformatsbelow,unlessspecifiedotherwise,yyrepresents thetwo-digityear(00-99),dddrepresentsthedayoftheyear(001-366), ccyyrepresentsthefour-digityear,mmrepresentsthemonth(01-12), ddrepresentstheday(01-31),xrepresentsadecimaldigit(0-9), sishexadecimal0-Fandisignored,andcrepresentsthecentury indicator(c=0istransformedto19,c=1istransformedto20and c>1istransformedto21).Format Description Y2T,Y2W,Y4T, Y4W (characterorzoneddecimaldate formatwithspecialindicators).Thedatefieldcanberepresented asfollows:3,Y2T:  C'yyx'orZ'yyx' 4,Y2T:  C'yyxx'orZ'yyxx' 5,Y2T:C'yyddd'orZ'yyddd' 6,Y2T:C'yymmdd'orZ'yymmdd' 7,Y4T:C'ccyyddd'orZ'ccyyddd' 8,Y4T:C'ccyymmdd'orZ'ccyymmdd' 3,Y2W:C'xyy'orZ'xyy' 4,Y2W:C'xxyy'orZ'xxyy' 5,Y2W:C'dddyy'orZ'dddyy' 6,Y2W:C'mmddyy'orZ'mmddyy' 7,Y4W:C'dddccyy'orZ'dddccyy' 8,Y4W:C'mmddccyy'orZ'mmddccyy' Thespecialindicators areX'00...00'(BIzeros),X'40...40'(blanks),C'0...0'(CHzeros), Z'0...0'(ZDzeros),C'9...9'(CHnines),Z'9...9'(ZDnines)and X'FF...FF'(BIones). Y2U,Y2V,Y2X, Y2Y,Y4U,Y4V,Y4X,Y4Y (packeddecimaldateformatwith specialindicators).Thedatefieldcanberepresentedasfollows:2,Y2U:  P'yyx'  (X'yyxs') 3,Y2V:P'yyxx'(X'0yyxxs') 3,Y2U:P'yyddd'(X'yyddds') 4,Y2V:P'yymmdd'(X'0yymmdds') 4,Y4U:P'ccyyddd'(X'ccyyddds') 5,Y4V:P'ccyymmdd'(X'0ccyymmdds') 2,Y2X:P'xyy'(X'xyys') 3,Y2Y:P'xxyy'(X'0xxyys') 3,Y2X:P'dddyy'(X'dddyys') 4,Y2Y:P'mmddyy'(X'0mmddyys') 4,Y4X:P'dddccyy'(X'dddccyys') 5,Y4Y:P'mmddccyy'(X'0mmddccyys') Thespecial indicatorsareP'0...0'(PDzeros)andP'9...9'(PDnines). Y2CorY2Z (two-digit,two-bytecharacteror zoned-decimalyeardata).Thetwo-digityeardatacanberepresented asfollows:xyxy yishexadecimal0-9andrepresents ayeardigit.xishexadecimal0-Fandisignored.Thus,96 mightberepresentedashexadecimalF9F6(character96)orashexadecimal F9C6or0906(zoneddecimal96). Y2P (two-digit,two-bytepacked-decimal yeardata).Thetwo-digityeardatacanberepresentedasfollows: xyyx yishexadecimal0-9andrepresentsayear digit.xishexadecimal0-Fandisignored.Thus,96mightberepresented ashexadecimal096For896C(packeddecimal96). Y2D (two-digit,one-bytedecimalyear data).Thetwo-digityeardatacanrepresentedasfollows:yy y ishexadecimal0-9andrepresentsayeardigit.Thus,96would berepresentedashexadecimal96(decimal96). Y2S (two-digit,two-bytecharacteror zoned-decimalyeardatawithspecialindicators).The two-digityeardatacanrepresentedasfollows: xyxy yishexadecimal0-9and representsayeardigit.xishexadecimal0-Fandisignored.Thus, 96mightberepresentedashexadecimalF9F6(character96)orashexadecimal F9C6or0906(zoneddecimal96). Thespecialindicatorscan berepresentedasfollows:qxzx qxishexadecimal00, 40orFF.zxishexadecimal00-FF(althoughtypically00,40and FF). Thus,specialindicatorsmightbehexadecimal0000,0005, 4040,FFFF,FF85andsoon. Y2B (two-digit,one-bytebinaryyear data).Thebinaryyeardatacanberepresentedasfollows:hh hh isthehexadecimalequivalentofadecimalyyvalueasfollows: BinaryValuesDecimalValuesyy X'00'-X'63'00-9900-99 X'64'-X'C7'100-19900-99 X'C8'-X'FF200-25500-55Thus, 96mightberepresentedashexadecimal60(decimal96)orC4(decimal 196). DT1 (SMFdateinterpretedasZ'yyyymmdd'). A4-byteSMFdatevalueintheformP'cyyddd'(X'0cyydddF')isconverted toaZ'yyyymmdd'value. DT2 (SMFdateinterpretedasZ'yyyymm'). A4-byteSMFdatevalueintheformP'cyyddd'(X'0cyydddF')isconverted toaZ'yyyymm'value. DT3 (SMFdateinterpretedasZ'yyyyddd'). A4-byteSMFdatevalueintheformP'cyyddd'(X'0cyydddF')isconverted toaZ'yyyyddd'value. DC1 (TODdateinterpretedasZ'yyyymmdd'). The8bytesofaninputclockvalue,inthebasictime-of-day(TOD) format,isconvertedtoaZ'yyyymmdd'value.TheSTCKCONVmacrois usedtodotheconversion. DC2 (TODdateinterpretedasZ'yyyymm'). The8bytesofaninputclockvalue,inthebasictime-of-day(TOD) format,isconvertedtoaZ'yyyymm'value.TheSTCKCONVmacroisused todotheconversion. DC3 (TODdateinterpretedasZ'yyyyddd'). The8bytesofaninputclockvalue,inthebasictime-of-day(TOD) format,isconvertedtoaZ'yyyyddd'value.TheSTCKCONVmacrois usedtodotheconversion. DE1 (ETODdateinterpretedasZ'yyyymmdd'). Thefirst8bytesofaninputclockvalue,intheextendedtime-of-day (ETOD)format,isconvertedtoaZ'yyyymmdd'value.TheSTCKCONV macroisusedtodotheconversion. DE2 (ETODdateinterpretedasZ'yyyymm'). Thefirst8bytesofaninputclockvalue,intheextendedtime-of-day (ETOD)formatisconvertedtoaZ'yyyymm'value.TheSTCKCONVmacro isusedtodotheconversion. DE3 (ETODdateinterpretedasZ'yyyyddd'). Thefirst8bytesofaninputclockvalue,intheextendedtime-of-day (ETOD)formatisconvertedtoaZ'yyyyddd'value.TheSTCKCONVmacro isusedtodotheconversion. Inthetimeformatsbelow,unlessspecifiedotherwise, hhrepresentsthehour(00-23),mmrepresentstheminutes(00-59), ssrepresentstheseconds(00-59),andxxrepresentshundredthsof asecond(00-99). In thetimeformatsbelow,unlessspecifiedotherwise,hhrepresents thehour(00-23),mmrepresentstheminutes(00-59),ssrepresents theseconds(00-59),andxxrepresentshundredthsofasecond(00-99).Format Description TM1 (SMFtimeinterpretedasZ'hhmmss'). A4-bytebinarySMFtimevalueinhundredthsofasecondisconverted toaZ'hhmmss'value. TM2 (SMFtimeinterpretedasZ'hhmm'). A4-bytebinarySMFtimevalueinhundredthsofasecondisconverted toaZ'hhmm'value. TM3 (SMFtimeinterpretedasZ'hh'). A4-bytebinarySMFtimevalueinhundredthsofasecondisconverted toaZ'hh'value. TM4 (SMFtimeinterpretedasZ'hhmmssxx'). A4-bytebinarySMFtimevalueinhundredthsofasecondisconverted toaZ'hhmmssxx'value. TC1 (TODtimeinterpretedasZ'hhmmss'). The8bytesofaninputclockvalue,inthebasictime-of-day(TOD) format,isconvertedtoaZ'hhmmss'value.TheSTCKCONVmacroisused todotheconversion. TC2 (TODtimeinterpretedasZ'hhmm'). The8bytesofaninputclockvalue,inthebasictime-of-day(TOD) format,isconvertedtoaZ'hhmm'value.TheSTCKCONVmacroisused todotheconversion. TC3 (TODtimeinterpretedasZ'hh'). The8bytesofaninputclockvalue,inthebasictime-of-day(TOD) format,isconvertedtoaZ'hh'value.TheSTCKCONVmacroisused todotheconversion. TC4 (TODtimeinterpretedasZ'hhmmssxx'). The8bytesofaninputclockvalue,inthebasictime-of-day(TOD) format,isconvertedtoaZ'hhmmssxx'value.TheSTCKCONVmacrois usedtodotheconversion. TE1 (ETODtimeinterpretedasZ'hhmmss'). Thefirst8bytesofaninputclockvalue,intheextendedtime-of-day (ETOD)format,isconvertedtoaZ'hhmmss'value.TheSTCKCONVmacro isusedtodotheconversion. TE2 (ETODtimeinterpretedasZ'hhmm'). Thefirst8bytesofaninputclockvalue,intheextendedtime-of-day (ETOD)format,isconvertedtoaZ'hhmm'value.TheSTCKCONVmacro isusedtodotheconversion. TE3 (ETODtimeinterpretedasZ'hh'). Thefirst8bytesofaninputclockvalue,intheextendedtime-of-day (ETOD)format,isconvertedtoaZ'hh'value.TheSTCKCONVmacro isusedtodotheconversion. TE4 (ETODtimeinterpretedasZ'hhmmssxx'). Thefirst8bytesofaninputclockvalue,intheextendedtime-of-day (ETOD)format,isconvertedtoaZ'hhmmssxx'value.TheSTCKCONV macroisusedtodotheconversion. 1 Theoverpunchsignbitisalways'C'forpositiveand'D'for negative. Parenttopic:Dataformatdescriptions



請為這篇文章評分?