c# code to view pdf file : Add page number pdf Library SDK class asp.net wpf azure ajax pspp4-part252

Chapter6:Thepspplanguage
33
The finalcharacter ina variablenameshouldnot be ‘_’,becausesome such
identifiersareusedforspecialpurposesbypsppprocedures.
Aswithallpsppidentifiers,variablenamesarenotcase-sensitive. psppcapi-
talizesvariablenames onoutputthesameway theywere capitalizedat their
pointofdefinitionintheinput.
Type
Numericorstring.
Width
(stringvariablesonly)Stringvariables withawidthof 8characters orfewer
arecalledshortstringvariables. Shortstringvariables s maybe usedinafew
contextswherelongstringvariables(thosewithwidthsgreaterthan8)arenot
allowed.
Position
Variables inthedictionary arearrangedinaspecificorder. . DISPLAYcanbe
usedtoshowthisorder: seeSection11.3[DISPLAY],page100.
Initialization
Eitherreinitializedto0orspacesforeachcase,orleftatitsexistingvalue.See
Section11.5[LEAVE],page101.
Missingvalues
Optionally,uptothreevalues,orarangeofvalues,or aspecificvalueplusa
range,canbespecifiedasuser-missingvalues. Thereisalsoasystem-missing
valuethatisassignedtoanobservationwhenthereisnootherobviousvaluefor
thatobservation. Observationswithmissingvaluesareautomaticallyexcluded
fromanalyses. User-missingvaluesare e actualdata values,whilethesystem-
missing value is s not a a value at all. . See Section 6.6 [Missing g Observations],
page32.
Variablelabel
Astringthatdescribesthevariable.SeeSection11.16[VARIABLELABELS],
page108.
Valuelabel
Optionally,theseassociateeachpossiblevalueofthevariablewithastring.See
Section11.13[VALUELABELS],page106.
Printformat
Displaywidth,format,and(fornumericvariables)numberofdecimalplaces.
Thisattributedoesnotaffecthowdataarestored,justhowtheyaredisplayed.
Example: a a widthof8, with2 decimalplaces. . See Section6.7.4[Inputand
OutputFormats],page34.
Writeformat
Similar to o print format, but t used by the e WRITE command (see Section 8.17
[WRITE],page80).
Customattributes
User-definedassociationsbetweennamesandvalues. SeeSection11.15[VARI-
ABLEATTRIBUTE],page107.
Role
Theintendedroleofavariableforuseindialogboxesingraphicaluserinter-
faces. SeeSection11.20[VARIABLEROLE],page109.
Add page number pdf - insert pages into PDF file in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Guide C# Users to Insert (Empty) PDF Page or Pages from a Supported File Format
adding page numbers in pdf file; add page number pdf
Add page number pdf - VB.NET PDF Page Insert Library: insert pages into PDF file in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
Easy to Use VB.NET APIs to Add a New Blank Page to PDF Document
add pages to pdf preview; add pages to pdf file
Chapter6:Thepspplanguage
34
6.7.2 VariablesAutomaticallyDefinedbypspp
There areseven systemvariables. . These e arenot like ordinary variables because system
variables are e not always s stored. . They y can be used only in expressions. . These e system
variables,whosevaluesandoutputformatscannotbemodified,aredescribedbelow.
$CASENUM Case e number ofthe case at themoment. . This s changes as cases are shuffled
around.
$DATE
Datethepsppprocesswasstarted,informatA9,followingthepatternDDMMM
YY.
$JDATE
Numberofdaysbetween15Oct1582andthetimethepsppprocesswasstarted.
$LENGTH
Pagelength,inlines,informatF11.
$SYSMIS
Systemmissingvalue,informatF1.
$TIME
Number of seconds between midnight 14 4 Oct t 1582 and the e time the active
datasetwasread,informatF20.
$WIDTH
Pagewidth,incharacters,informatF3.
6.7.3 Listsofvariablenames
Torefer toaset ofvariables,listtheirnamesoneafter another. . Optionally,their r names
maybeseparatedbycommas. Toincludearangeofvariablesfromthedictionaryinthe
list,writethenameofthefirstandlastvariableintherange,separatedbyTO.Forinstance,
ifthedictionarycontainssixvariableswiththenamesID,X1,X2,GOAL,MET,andNEXTGOAL,
inthatorder,thenX2TOMETwouldincludevariablesX2,GOAL,andMET.
Commandsthatdefinevariables,suchasDATALIST,giveTOanalternatemeaning.With
thesecommands,TOdefinesequencesofvariableswhosenamesendinconsecutiveintegers.
Thesyntaxistwoidentifiersthatbeginwiththesamerootandendwithnumbers,separated
by TO. . The e syntax x X1TOX5 defines 5 5 variables, named d X1, X2, X3, X4, and d X5. . The
syntaxITEM0008TOITEM0013defines6variables,namedITEM0008,ITEM0009,ITEM0010,
ITEM0011,ITEM0012,andITEM00013.ThesyntaxesQUES001TOQUES9andQUES6TOQUES3
areinvalid.
AfterasetofvariableshasbeendefinedwithDATALISToranothercommandwiththis
method,thesamesetcanbereferencedonlatercommandsusingthesamesyntax.
6.7.4 InputandOutputFormats
Aninputformatdescribes howtointerpretthecontentsofaninputfieldasanumber or
astring. Itmight t specifythat the fieldcontainsanordinarydecimalnumber,atime or
date,anumberinbinaryorhexadecimalnotation,oroneofseveralothernotations.Input
formats areusedby commandssuchas DATALISTthat readdataorsyntaxfilesintothe
psppactivedataset.
Everyinputformatcorrespondstoadefaultoutputformatthatspecifiestheformatting
usedwhenthevalue isoutput later. . Itis s alwayspossible toexplicitlyspecifyanoutput
formatthatresemblestheinputformat.Usually,thisisthedefault,butincaseswherethe
inputformatisunfriendlytohumanreadability,suchasbinaryorhexadecimalformats,the
defaultoutputformatisaneasier-to-readdecimalformat.
C# PDF insert text Library: insert text into PDF content in C#.net
pageIndex, The page index of the PDF page that will be 0
add page numbers to pdf files; add contents page to pdf
C# PDF File Split Library: Split, seperate PDF into multiple files
If your page number is set as 1, then the two output PDF files will contains the first page and the later three pages Add necessary references:
adding page to pdf in preview; add page number to pdf online
Chapter6:Thepspplanguage
35
Everyvariablehastwooutputformats,calledits printformatandwriteformat. . Print
formats are e used d in most output contexts; ; write e formats are used only by WRITE (see
Section8.17[WRITE],page 80). Newly y createdvariables have identicalprint andwrite
formats, and FORMATS, the e most commonly used command for r changing g formats (see
Section11.4[FORMATS],page101),setsbothofthemtothesamevalueaswell. Thus,
mostofthetime,thedistinctionbetweenprintandwriteformatsisunimportant.
Inputandoutputformatsarespecifiedtopsppwithaformatspecificationoftheform
TYPEwor TYPEw.d, , where TYPE is s oneofthe formattypes describedlater, , w w is s afield
widthmeasuredincolumns,anddisanoptionalnumberofdecimalplaces.Ifdisomitted,
avalueof0isassumed. Someformatsdonotallowanonzerodtobespecified.
Thefollowingsectionsdescribetheinputandoutputformatssupportedbypspp.
6.7.4.1 BasicNumericFormats
Thebasicnumericformatsareusedforinput andoutputofrealnumbersinstandardor
scientific notation. . The e following table shows s an example e of how each format displays
positiveandnegativenumberswiththedefaultdecimalpointsetting:
Format
3141.59
-3141.59
F8.2
3141.59
-3141.59
COMMA9.2
3,141.59
-3,141.59
DOT9.2
3.141,59
-3.141,59
DOLLAR10.2
$3,141.59
-$3,141.59
PCT9.2
3141.59%
-3141.59%
E8.1
3.1E+003
-3.1E+003
Onoutput,numbersinFformatareexpressedinstandarddecimalnotationwiththe
requestednumberofdecimalplaces.Theotherformatsoutputsomevariationonthisstyle:
 NumbersinCOMMAformatareadditionallygroupedeverythreedigitsbyinserting
agroupingcharacter. The e grouping characteris ordinarilya comma, but it can be
changedtoaperiod(see[SETDECIMAL],page162).
 DOTformatislikeCOMMAformat,butitinterchangestheroleofthedecimalpoint
andgroupingcharacters. Thatis,thecurrentgroupingcharacterisusedasadecimal
pointandviceversa.
 DOLLARformatislikeCOMMAformat,butitprefixesthenumberwith‘$’.
 PCTformatislikeFformat,butadds‘%’afterthenumber.
 TheEformatalwaysproducesoutputinscientificnotation.
Oninput,thebasicnumericformatsacceptpositiveandnumbersinstandarddecimal
notationorscientificnotation. Leadingandtrailingspacesareallowed. Anemptyorall-
spaces field, , or r one that contains only a single period, , is treatedas s the systemmissing
value.
Inscientificnotation,theexponentmaybeintroducedbyasign(‘+’or‘-’),orbyoneof
theletters‘e’or‘d’(inuppercaseorlowercase),orbyaletterfollowedbyasign. Asingle
spacemayfollowtheletterorthesignorboth.
VB.NET PDF File Split Library: Split, seperate PDF into multiple
can split target multi-page PDF document file to one-page PDF files or PDF file to smaller PDF documents by every given number of pages Add necessary references
add page number to pdf in preview; add a page to a pdf in acrobat
C# PDF Text Search Library: search text inside PDF file in C#.net
Add necessary references: Description: Search specified string from all the PDF pages. eg: The first page is 0. 0
adding page numbers pdf file; add pages to pdf document
Chapter6:Thepspplanguage
36
Onfixed-formatDATALIST(seeSection8.5.1[DATALISTFIXED],page66)andina
fewothercontexts,decimalsareimpliedwhenthefielddoes notcontainadecimalpoint.
InF6.5format,for example,thefield314159 istakenas the value3.14159withimplied
decimals. Decimalsareneverimpliedifanexplicitdecimalpointispresentorifscientific
notationisused.
EandF formats acceptthebasicsyntax already described. . The e other formats allow
someadditionalvariations:
 COMMA,DOLLAR,andDOTformatsignoregroupingcharacterswithintheinteger
partoftheinputfield. Theidentityofthegroupingcharacterdependsontheformat.
 DOLLAR R format allows adollar signtoprecede thenumber. . Inanegativenumber,
thedollarsignmayprecedeorfollowtheminussign.
 PCTformatallowsapercentsigntofollowthenumber.
Allofthebasicnumberformatshaveamaximumfieldwidthof40andacceptnomore
than16decimalplaces,onbothinputandoutput.Someadditionalrestrictionsapply:
 Asinputformats,thebasicnumericformatsallownomoredecimalplacesthanthefield
width.Asoutputformats,thefieldwidthmustbegreaterthanthenumberofdecimal
places;thatis,largeenoughtoallowforadecimalpointandthenumberofrequested
decimalplaces. DOLLARandPCT T formatsmustallowanadditionalcolumnfor‘$’
or‘%’.
 Thedefaultoutputformatforagiveninputformatincreasesthefieldwidthenoughto
makeroomforoptionalinputcharacters. Ifaninputformatcallsfordecimalplaces,
thewidthis increasedby 1 to make roomfor animplied d decimalpoint. . COMMA,
DOT,andDOLLARformatsalsoincreasetheoutputwidthtomakeroomforgrouping
characters. DOLLARandPCTfurther r increasetheoutputfieldwidthby1tomake
roomfor‘$’or ‘%’. . Theincreasedoutputwidthis s cappedat 40,themaximumfield
width.
 TheEformatisexceptional. . Foroutput,Eformathasaminimumwidthof7plusthe
number ofdecimalplaces. . Thedefaultoutput t formatforanEinputformatis anE
formatwithatleast3decimalplacesandthusaminimumwidthof10.
Moredetailsofbasicnumericoutputformattingaregivenbelow:
 Outputroundstonearest,withtiesroundedawayfromzero. . Thus,2.5isoutputas3
inF1.0format,and-1.125as-1.13inF5.1format.
 The e system-missing g value e is output as a a period in n a a field d of f spaces, , placed d in the
decimalpoint’sposition,orintherightmostcolumnifnodecimalplacesarerequested.
Aperiodisusedevenifthedecimalpointcharacterisacomma.
 Anumberthatdoesnotfillitsfieldisright-justifiedwithinthefield.
 Anumberistoolargeforitsfieldcausesdecimalplacestobedroppedtomakeroom.
Ifdroppingdecimalsdoesnotmakeenoughroom,scientificnotationisusedifthefield
iswideenough. Ifanumber r doesnotfit inthefield,eveninscientificnotation,the
overflowisindicatedbyfillingthefieldwithasterisks(‘*’).
 COMMA, , DOT, and DOLLAR formats insert grouping g characters only if space is
available for r all of f them. . Grouping g characters are e never r inserted d when all decimal
places mustbedropped. . Thus,1234.56in n COMMA5.2 format t is output as ‘ ‘ 1235’
C# PDF delete text Library: delete, remove text from PDF file in
Add necessary references: RasterEdge.Imaging.Basic.dll. matchString, The string wil be deleted from PDF file, -. 0
add page numbers to a pdf in preview; adding page numbers to pdf document
C# PDF Text Highlight Library: add, delete, update PDF text
200F); annot.EndPoint = new PointF(300F, 400F); // add annotation to The string wil be highlighted from PDF file, 0
adding page numbers to a pdf in preview; add page to existing pdf file
Chapter6:Thepspplanguage
37
withoutacomma,eventhoughthereisroomforone,becausealldecimalplaceswere
dropped.
 DOLLAR R or PCT format dropthe‘$’or ‘%’onlyif the number wouldnot fit atall
withoutit.Scientificnotationwith‘$’or‘%’ispreferredtoordinarydecimalnotation
withoutit.
 Except t inscientificnotation,adecimalpointis includedonlywhenit isfollowedby
adigit. If f theintegerpart of the number beingoutput is 0,andadecimalpoint is
included,thenthezerobeforethedecimalpointisdropped.
In scientific notation, the number r always includes a decimal l point, evenif it t is not
followedbyadigit.
 Anegativenumberincludesaminussignonlyinthepresenceofanonzerodigit: : -0.01
is output as ‘-.01’ ’ inF4.2format t but as ‘ ‘ .0’inF4.1format. . Thus, , a“negative
zero”neverincludesaminussign.
 InnegativenumbersoutputinDOLLAR R format,thedollarsignfollowsthenegative
sign.Thus,-9.99inDOLLAR6.2formatisoutputas-$9.99.
 Inscientificnotation,theexponent t isoutputas ‘E’followedby‘+’or ‘-’andexactly
threedigits.Numberswithmagnitudelessthan10**-999orlargerthan10**999arenot
supportedbymostcomputers,butiftheyaresupportedthentheiroutputisconsidered
tooverflowthefieldandwillbeoutputasasterisks.
 Onmost t computers, , nomore than 15decimaldigits s are significant in n output,even
ifmore are printed. . Inany y case,output precisioncannot be any higherthan n input
precision; few w data a sets s are e accurate to 15 digits s of f precision. . Unavoidable e loss s of
precisioninintermediatecalculationsmayalsoreduceprecisionofoutput.
 Specialvaluessuchasinfinitiesand“notanumber”valuesareusuallyconvertedtothe
system-missingvaluebeforeprinting. Inafewcircumstances,thesevaluesareoutput
directly. In n fields s ofwidth3orgreater, , specialvalues s areoutputas however many
characters will fit t from m +Infinity or r -Infinity for infinities, , from NaN N for “not a
number,”orfromUnknown for othervalues(ifanyaresupportedbythesystem). . In
fieldsunder3columnswide,specialvaluesareoutputasasterisks.
6.7.4.2 CustomCurrencyFormats
Thecustom currencyformats s areclosely relatedtothe basicnumeric formats, , but t they
allowuserstocustomizetheoutputformat.TheSETcommandconfigurescustomcurrency
formats,usingthesyntax
SETCCx="string".
wherex isA,B,C,D,orE,andstringisnomorethan16characterslong.
stringmustcontainexactlythreecommasorexactlythreeperiods(butnotboth),except
thatasinglequotecharactermaybeusedto“escape”afollowingcomma,period,orsingle
quote.Ifthreecommasareused,commaswillbeusedforgroupinginoutput,andaperiod
willbeusedasthedecimalpoint.Usesofperiodsreversestheseroles.
Thecommas orperiodsdividestring intofourfields,calledthenegativeprefix,prefix,
suffix,andnegativesuffix,respectively.Theprefixandsuffixareaddedtooutputwhenever
spaceis available. . Thenegativeprefixandnegativesuffixarealwaysaddedtoanegative
numberwhentheoutputincludesanonzerodigit.
C# PDF File & Page Process Library SDK for C#.net, ASP.NET, MVC
Highlight Text. Add Text. Add Text Box. Drawing Markups. PDF Print. Work with Other SDKs. Please note that, PDF page number starts from 0.
adding a page to a pdf in preview; adding a page to a pdf document
C# PDF Page Delete Library: remove PDF pages in C#.net, ASP.NET
Add necessary references: RasterEdge.Imaging.Basic.dll. 0
add page to pdf preview; add a page to a pdf in reader
Chapter6:Thepspplanguage
38
The followingsyntaxshowshowcustomcurrency formats couldbeusedtoreproduce
basicnumericformats:
SET CCA="-,,,". . /* * Same as COMMA.
SET CCB="-...". . /* * Same as DOT.
SET CCC="-,$,,". /* Same as DOLLAR.
SET CCD="-,,%,". /* Like PCT, but groups with h commas.
Herearesomemoreexamplesofcustomcurrencyformats.Thefinalexampleshowshow
touseasinglequotetoescapeadelimiter:
SET CCA=",EUR,,-".
/* Euro.
SET CCB="(,USD ,,)". . /* US dollar.
SET CCC="-.R$..".
/* Brazilian n real.
SET CCD="-,, , NIS,". . /* * Israel l shekel.
SET CCE="-.Rp’. . ..". /* Indonesia a Rupiah.
Theseformatswouldyieldthefollowingoutput:
Format
3145.59
-3145.59
CCA12.2
EUR3,145.59
EUR3,145.59-
CCB14.2
USD3,145.59
(USD3,145.59)
CCC11.2
R$3.145,59
-R$3.145,59
CCD13.2
3,145.59NIS
-3,145.59NIS
CCE10.0
Rp.3.146
-Rp.3.146
Thedefaultforallthecustomcurrencyformatsis‘-,,,’,equivalenttoCOMMAformat.
6.7.4.3 LegacyNumericFormats
TheNandZnumeric formatsprovidecompatibility withlegacy fileformats. . They y have
muchincommon:
 Output t is roundedtothe nearest representable value, , with ties s roundedaway from
zero.
 Numberstoolargetodisplayareoutputasafieldfilledwithasterisks(‘*’).
 The e decimal point is always implicitly thespecifiednumber ofdigits fromtheright
edgeofthefield,exceptthatZformatinputallowsanexplicitdecimalpoint.
 Scientificnotationmaynotbeused.
 The e system-missing value is s output t as s a a period ina fieldof spaces. . The e period is
placedjusttotherightoftheimplieddecimalpointinZformat,orat therightend
inNformatorinZformatifnodecimalplacesarerequested.Aperiodisusedevenif
thedecimalpointcharacterisacomma.
 Fieldwidthmayrangefrom1to40. . Decimalplacesmayrangefrom0uptothefield
width,toamaximumof16.
 Whenalegacynumericformatusedforinputisconvertedtoanoutputformat,itis
changedintotheequivalentFformat. Thefieldwidthisincreasedby1ifanydecimal
placesarespecified,tomakeroomforadecimalpoint.ForZformat,thefieldwidthis
increasedby1morecolumn,tomakeroomforanegativesign.Theoutputfieldwidth
iscappedat40columns.
Chapter6:Thepspplanguage
39
NFormat
TheNformatsupportsinputandoutputoffieldsthatcontainonlydigits.Oninput,leading
ortrailingspaces,adecimalpoint,oranyothernon-digitcharactercausesthefieldtobe
readasthesystem-missingvalue. Asaspecialexception,anNformatusedonDATALIST
FREEorDATALISTLISTistreatedastheequivalentFformat.
Onoutput,Npadsthefieldonthe left withzeros. . Negative e numbersareoutput like
thesystem-missingvalue.
ZFormat
TheZformatisa“zoneddecimal”formatusedonIBMmainframes.Zformatencodesthe
signaspartofthefinaldigit,whichmustbeoneofthefollowing:
0123456789
{ABCDEFGHI
}JKLMNOPQR
wherethecharactersineachrowrepresentdigits0through9inorder. Charactersinthe
firsttworowsindicateapositivesign;thoseinthethirdindicateanegativesign.
Onoutput,Zfieldsarepaddedontheleftwithspaces. Oninput,leadingandtrailing
spacesareignored. Anycharacterinaninputfieldotherthanspaces,thedigitcharacters
above,and‘.’causesthefieldtobereadassystem-missing.
Thedecimalpointcharacterforinputandoutputisalways‘.’,evenifthedecimalpoint
characterisacomma(see[SETDECIMAL],page162).
Nonzero, negative values s output in Z format are marked d as s negative e even when no
nonzerodigitsareoutput.Forexample,-0.2isoutputinZ1.0formatas‘J’. The“negative
zero”valuesupportedbymostmachinesisoutputaspositive.
6.7.4.4 BinaryandHexadecimalNumericFormats
Thebinaryandhexadecimalformatsareprimarilydesignedforcompatibilitywithexisting
machine formats, not t for human readability. . All l of them therefore have a F format as
default output format. . Some e of these formats areonly portable betweenmachines with
compatiblebyteordering(endianness)orfloating-pointformat.
Binaryformatsusebytevaluesthatintextfilesareinterpretedasspecialcontrolfunc-
tions,suchas carriage returnandline feed. . Thus,datainbinary y formats shouldnot be
includedinsyntaxfilesorreadfromdatafileswithvariable-lengthrecords,suchasordinary
textfiles. Theymaybereadfromorwrittentodatafiles s withfixed-lengthrecords. . See
Section8.8[FILEHANDLE],page70,forinformationonworkingwithfixed-lengthrecords.
PandPKFormats
Thesearebinary-codeddecimalformats,inwhicheverybyte(exceptthelast,inPformat)
represents two decimaldigits. . The e most-significant 4 bits of the first byte is the most-
significant decimaldigit,the least-significant 4 bits of the first byte is the next decimal
digit,andsoon.
InPformat,themost-significant4bitsofthelastbytearetheleast-significantdecimal
digit. Theleast-significant4bitsrepresentthesign:decimal15indicatesanegativevalue,
decimal13indicatesapositivevalue.
Chapter6:Thepspplanguage
40
Numbers are e rounded downward on output. . The e system-missingvalue and numbers
outsiderepresentablerangeareoutputaszero.
Themaximumfieldwidthis16.Decimalplacesmayrangefrom0uptothenumberof
decimaldigitsrepresentedbythefield.
The default output format is anF formatwithtwice theinput fieldwidth,plus one
columnforadecimalpoint(ifdecimalplaceswererequested).
IBandPIBFormats
Theseareintegerbinaryformats. IBreadsandwrites2’scomplementbinaryintegers,and
PIBreadsandwritesunsignedbinary integers. . The e byteorderingis by default the host
machine’s,butSET RIB may be usedto select aspecific byte orderingfor reading(see
[SETRIB],page162)andSETWIB,similarly,forwriting(see[SETWIB],page165).
Themaximumfieldwidthis8. Decimalplacesmayrangefrom0uptothenumberof
decimaldigitsinthelargestvaluerepresentableinthefieldwidth.
ThedefaultoutputformatisanFformatwhosewidthisthenumberofdecimaldigits
inthelargestvaluerepresentableinthefieldwidth,plus1iftheformathasdecimalplaces.
RBFormat
Thisisabinaryformatforrealnumbers. Bydefaultitreadsandwritesthehostmachine’s
floating-point format, , but t SET T RRB may y be e used to o select an n alternate e floating-point
formatforreading(see[SETRRB],page163)andSET WRB,similarly,for writing(see
[SETWRB],page165).
The recommended field d width depends on the e floating-point format. . NATIVE E (the
default format),IDL,IDB,VD,VG,andZLformatsshoulduseafieldwidthof8. . ISL,
ISB,VF,andZSformatsshoulduseafieldwidthof4.Otherfieldwidthswillnotproduce
usefulresults.Themaximumfieldwidthis8.Nodecimalplacesmaybespecified.
ThedefaultoutputformatisF8.2.
PIBHEXandRBHEXFormats
Thesearehexadecimalformats,forreadingandwritingbinaryformatswhereeachbytehas
beenrecodedasapairofhexadecimaldigits.
Ahexadecimalfieldconsistssolelyofhexadecimaldigits‘0’...‘9’and‘A’...‘F’.Upper-
caseandlowercaseareacceptedoninput;outputisinuppercase.
Other thanthe e hexadecimalrepresentation, these formats are equivalent to PIB and
RBformats,respectively. However,bytesinPIBHEXformatarealwaysorderedwiththe
most-significantbytefirst(big-endianorder),regardlessofthehostmachine’snativebyte
orderorpsppsettings.
Fieldwidths must be evenandbetween2and16. . RBHEXformat t allows nodecimal
places;PIBHEXallowsasmanydecimalplacesasaPIBformatwithhalfthegivenwidth.
6.7.4.5 TimeandDateFormats
Inpspp,atimeisaninterval. Thetimeformatstranslatebetweenhuman-friendlydescrip-
tionsoftimeintervalsandpspp’sinternalrepresentationoftimeintervals,whichissimply
thenumberofsecondsintheinterval. pspphastwotimeformats:
Chapter6:Thepspplanguage
41
TimeFormat
Template
Example
TIME
hh:MM:SS.ss
04:31:17.01
DTIME
DDHH:MM:SS.ss
0004:31:17.01
Adateisamomentinthepastorthefuture. Internally,pspprepresentsadateasthe
number ofsecondssincethe epoch,midnight,Oct. . 14,1582. . Thedateformatstranslate
betweenhuman-readabledatesandpspp’snumericrepresentationofdatesandtimes. pspp
hasseveraldateformats:
DateFormat
Template
Example
DATE
dd-mmm-yyyy
01-OCT-1978
ADATE
mm/dd/yyyy
10/01/1978
EDATE
dd.mm.yyyy
01.10.1978
JDATE
yyyyjjj
1978274
SDATE
yyyy/mm/dd
1978/10/01
QYR
qQyyyy
3Q1978
MOYR
mmmyyyy
OCT1978
WKYR
wwWKyyyy
40WK1978
DATETIME
dd-mmm-yyyyHH:MM:SS.ss
01-OCT-197804:31:17.01
Thetemplatesintheprecedingtablesdescribehowthetimeanddateformatsareinput
andoutput:
dd
Dayofmonth,from1to31. Alwaysoutputastwodigits.
mm
mmm
Month.Inoutput,mmisoutputastwodigits,mmmasthefirstthreelettersofan
Englishmonthname(January,February,...).Ininput,bothoftheseformats,
plusRomannumerals,areaccepted.
yyyy
Year.Inoutput,DATETIMEalwaysproducesa4-digityear;otherformatscan
producea2-or4-digityear.Thecenturyassumedfor2-digityearsdependson
theEPOCHsetting(see[SETEPOCH],page162). Inoutput,ayearoutside
theepochcausesthewholefieldtobefilledwithasterisks(‘*’).
jjj
Dayofyear(Julianday),from1to366. Thisisexactlythreedigitsgivingthe
countofdaysfromthestartoftheyear.January1isconsideredday1.
q
Quarterofyear,from1to4.QuartersstartonJanuary1,April1,July1,and
October1.
ww
Weekofyear,from1to53.Outputasexactlytwodigits. January1isthefirst
dayofweek1.
DD
Countofdays,whichmaybepositiveornegative.Outputasatleasttwodigits.
hh
Count ofhours, , whichmay y bepositive or negative. . Output t as at least two
digits.
HH
Hourofday,from0to23. Outputasexactlytwodigits.
Chapter6:Thepspplanguage
42
MM
Minuteofhour,from0to59. Outputasexactlytwodigits.
SS.ss
Secondswithinminute,from0to59.Theintegerpartisoutputasexactlytwo
digits.Onoutput,secondsandfractionalsecondsmayormaynotbeincluded,
dependingonfieldwidthanddecimalplaces.Oninput,secondsandfractional
secondsareoptional. TheDECIMALsettingcontrols s thecharacter accepted
anddisplayedasthedecimalpoint(see[SETDECIMAL],page162).
For output, , the dateandtimeformats s use thedelimiters indicatedinthetable. . For
input,date components may be separated by spaces or byoneof thecharacters ‘-’,‘/’,
‘.’,or‘,’,andtimecomponentsmaybeseparatedbyspaces,‘:’,or‘.’. Oninput,the‘Q’
separatingquarterfromyearandthe‘WK’separatingweekfromyearmaybeuppercaseor
lowercase,andthespacesaroundthemareoptional.
Oninput,alltime anddate formats accept any amount ofleadingandtrailingwhite
space.
The maximum widthfor time and date formats is 40columns. . Minimum m input t and
outputwidthforeachofthetimeanddateformatsisshownbelow:
Format
Min. InputWidth
Min.OutputWidth
Option
DATE
8
9
4-digityear
ADATE
8
8
4-digityear
EDATE
8
8
4-digityear
JDATE
5
5
4-digityear
SDATE
8
8
4-digityear
QYR
4
6
4-digityear
MOYR
6
6
4-digityear
WKYR
6
8
4-digityear
DATETIME
17
17
seconds
TIME
5
5
seconds
DTIME
8
8
seconds
Inthetable,“Option”describeswhatincreasedoutputwidthenables:
4-digityear
Afield2columnswiderthanminimumwillincludea4-digityear.(DATETIME
formatalwaysincludesa4-digityear.)
seconds
Afield3columnswiderthanminimumwillincludesecondsaswellasminutes.
Afield5 columnswider thanminimum, or more, canalso include adecimal
pointandfractionalseconds(butnomorethanallowedbytheformat’sdecimal
places).
Forthetimeanddateformats,thedefaultoutputformatisthesameastheinputformat,
exceptthatpsppincreasesthefieldwidth,ifnecessary,totheminimumallowedforoutput.
Timeordatesnarrowerthanthefieldwidthareright-justifiedwithinthefield.
Whenatimeordateexceedsthefieldwidth,charactersaretrimmedfromtheenduntil
itfits. Thiscanoccur r inanunusualsituation,e.g.withayear greater than9999(which
adds anextradigit),or foranegative value onTIMEor DTIME(whichadds aleading
minussign).
Documents you may be interested
Documents you may be interested