physical file basics

Upload: sree-ram

Post on 01-Jun-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 Physical File basics

    1/57

    Chapter 1. PHYSICAL FILES

    CHAPTER OBJECTIVESUpon complet on o! th " chapter# $o% "ho%l& 'e a'le to

    o E(pla n the h erarch$ o! &ata) *le# recor&"# an& *el&".

    o +e"cr 'e the & ,erence" 'et-een an alphan%mer ccharacter/ *el 0one& &ec mal *el an& pac e&

    &ec mal *el&.

    o E(pla n the EBC+IC E(ten&e& B nar$ Co&e& +ec malInterchan2e Co&e/ repre"entat on !or "tor n2 &ata.

    o E(pla n an& &emon"trate ho- +ata +e"cr pt onSpec *cat on" ++S/ are %"e& to &e"cr 'e *le".

    o +e"cr 'e the & ,erence" 'et-een arr 3al "e4%ence an&e$e& "e4%ence acce"" path".

    HIERARCHY OF +ATAPro2ramm n2 lan2%a2e" "%ch a" COBOL5677 pro3 &e thecomp%ter - th the n"tr%ct on" to per!orm "pec *c ta" ".8ormall$# the"e n"tr%ct on" ncl%&e acce"" n2 &ata. Data are%nor2an 0e& ra- !act".

    To proce"" &ata n an or2an 0e& -a$# &ata area" are "et a" &en the comp%ter9" memor$ !or *el&"# recor&"# an& *le". A *el&" a 2ro%p o! "tora2e po" t on" re"er3e& !or a "pec *c &atatem. For e(ample# ! a reta l or2an 0at on -ante& to "tore

    &ata a'o%t the r emplo$ee"# t -o%l& pro'a'l$ -ant toncl%&e the !ollo- n2 &ata tem") emplo$ee n%m'er# "tore

    n%m'er# emplo$ee name# &epartment n%m'er# ho%rl$ rate#ho%r" -or e "ale"# an& "o on. Each &ata tem &e"cr 'e" one"pec *c element o! the emplo$ee an& " "tore& a" a *el&.S%ppo"e an emplo$ee9" n%m'er " :;66. Eno%2h

  • 8/9/2019 Physical File basics

    2/57

    "tora2e po" t on" -o%l& 'e "et a" &e to "tore th " 3al%e n theemplo$ee n%m'er *el&.

    E(am ne the emplo$ee n%m'er *el& n F 2%re 1.1 an&

    o'"er3e that the 3al%e :;66 " "tore& n a "tora2e areaallocate& to the emplo$ee n%m'er *el&. In a&& t on# "tora2e"pace " allocate& to "tore the emplo$ee9" la"t name. In th "e(ample# the 3al%e Han"en " "tore& n the emplo$ee la"tname *el&.

    Figure 1.1. Allocating storage positions for the employee numberand last name elds.

    A record " a collect on o! relate& &ata *el&" "tore& a" a %n t.In o%r e(ample# the *el&" !or each emplo$ee are 2ro%pe&to2ether to !orm one emplo$ee recor& a" "ho-n n F 2%re 1.? .@ th n each emplo$ee recor& " "pec *c &ata rele3ant to oneemplo$ee n the or2an 0at on.

    Figure 1.2. Group of related elds that are stored as one employeerecord.

    8ote that the recor& n F 2%re 1.? " ll%"trate& n ta'le !orm!or ea"e o! rea& n2. @hen "tore& n the comp%ter# a recor& ""tore& a" cont 2%o%" *el&" that %"%all$ &o not ncl%&e "pace"'et-een *el&"# per o&"# or comma". The "$m'ol repre"ent"an mpl e& &ec mal po nt an& " not "tore& n the recor&. Al"o#the ne2at 3e " 2n "ho-n n the Sale" *el& " %"e& torepre"ent a ne2at 3e 3al%e. @e - ll "ee later n th " chapterho- ne2at 3e 3al%e" are "tore& n the comp%ter.

    A le or data le " a collect on o! recor&" perta n n2 to a"pec *c appl cat on. F 2%re 1.> "ho-" the *r"t 1= recor&"

    https://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#allocating_storage_positions_for_the_emphttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#group_of_related_fields_that_are_storedhttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#group_of_related_fields_that_are_storedhttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#group_of_related_employee_records_that_ahttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#group_of_related_fields_that_are_storedhttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#group_of_related_fields_that_are_storedhttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#group_of_related_employee_records_that_ahttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#allocating_storage_positions_for_the_emp
  • 8/9/2019 Physical File basics

    3/57

    !rom the Emplo$ee Pa$ *le. Each recor& repre"ent" &ata !orone emplo$ee o! the or2an 0at on. A pa$roll *le# acco%nt"rece 3a'le *le# n3entor$ *le# an& "ale" *le are e(ample" o!commonl$ %"e& *le" n '%" ne"" appl cat on".

    Figure 1.3. Group of related employee records that are stored in oneemployee le.

    In mo"t n"tance"# a comp%ter appl cat on "$"tem - ll ncl%&e"e3eral relate& *le"# -h ch are re!erre& to a" a &ata'a"e.

    Th%"# a database " &e*ne& a" the o3erall collect on o! *le"n a comp%ter appl cat on "$"tem that can 'e o ne&.

    +ata are 2ro%pe& an& "tore& n *el&"# recor&"# *le"# an& a&ata'a"e. Internall$# &ata are "tore& & ,erentl$ &epen& n2%pon the comp%ter "$"tem %"e&. 8e(t# -e & "c%"" ho- &ataare "tore& - th n IB m &ran2e comp%ter".

    I8TER8AL BI8ARY

    REPRESE8TATIO8 OF +ATA The t-o comp%ter co&e" %"e& !or nternal ' nar$repre"entat on are EBC+IC an& ASCII. crocomp%ter" an&nonDIB comp%ter 3en&or" %"e ASCII. ASCII "tan&"!or Amer can S tan&ar& Co&e !or In!ormat on Interchan2e an&

    " prono%nce& ass-key .

    IB m &ran2e an& ma n!rame comp%ter" %"e the EBC+ICco& n2 "$"tem an& " the onl$ co&e ll%"trate& n th "'oo . EB D! # prono%nce& eb-ce-dick # "tan&"

  • 8/9/2019 Physical File basics

    4/57

    !or E(ten&e& B nar$ Co&e& Dec mal Interchan2e Co&e an& "%"e& to repre"ent letter"# & 2 t"# the character 'lan # an&"pec al character". The chart n

    F 2%re 1.6 ll%"trate" the EBC+IC co&e" !or letter"# n%m'er"#an& the character 'lan . It al"o & "pla$" the ' nar$repre"entat on an& he(a&ec mal he(/ co&e" %"e& '$ thecomp%ter to repre"ent EBC+IC co&e". Yo% nee& not memor 0eth " chart# '%t $o% "ho%l& 'e !am l ar - th the"e metho&" !orrepre"ent n2 &ata.

    Figure 1.". EB D! codes for letters# numbers# character blan$# andcorresponding binary and he%adecimal codes.

    There are t me" -hen t " nece""ar$ to & "pla$ &ata a" t "ph$" call$ "tore&. Ho-e3er# t can 'e & c%lt to %n&er"tan&&ata n t" ' nar$ !orm. In"tea each :D' t EBC+IC '$te "con3erte& to a t-oDcharacter he(a&ec mal 3al%e a" "ho-n

    n F 2%re" 1.6 an& 1.= .

    https://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#ebcdic_codes_for_letters_comma_numhttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#ebcdic_codes_for_letters_comma_numhttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#bit_binary_combinations_and_correspondhttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#ebcdic_codes_for_letters_comma_numhttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#ebcdic_codes_for_letters_comma_numhttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#bit_binary_combinations_and_correspond
  • 8/9/2019 Physical File basics

    5/57

    Figure 1.&. "'bit binary combinations and correspondinghe%adecimal characters.

    Each 6D' t port on o! a '$te " repre"ente& '$ onehe(a&ec mal character. He(a&ec mal character" can ran2e!rom 7 all ' t" o, 7777/ to F all 6 ' t" on 1111/. Th%"#the !%ll ran2e o! 6D' t ' nar$ com' nat on" an& the rhe(a&ec mal character" " "ho-n n F 2%re 1.= .

    F 2%re 1.; ll%"trate" the ' nar$ an& he(a&ec mal he(/repre"entat on !or the cap tal letter A. In EBC+IC# each"tora2e po" t on or '$te con" "t" o! e 2ht ' t" ' nar$ & 2 t"/.

    The"e e 2ht ' t" are 'ro en nto t-o 6D' t "e2ment") the h 2hDor&er !o%r ' t" are %"e& to "pec !$ the zone port on an& thelo-Dor&er !o%r ' t" are %"e& to "pec !$ the digit port on.

    The !o%r h 2hDor&er 0one ' t" are %"e& to n& cate -hetherthe 3al%e "tore& n the '$te " a letter# po" t 3e n%m'er#ne2at 3e n%m'er# or "pec al character. The !o%r lo-Dor&er& 2 t ' t" are %"e& to repre"ent the n%m'er" 7 thro%2h

  • 8/9/2019 Physical File basics

    6/57

    & 2 t ' t" then - ll n& cate -h ch "pec *c letter !rom Athro%2h I " 'e n2 repre"ente&. The & 2 t ' t" can repre"ent 7thro%2h < a" 7777# 7771# 7717# 7711# . . . 1771.

    Figure 1.(. Binary representation of a single byte representing theletter A.

    +ATA TYPES There are "e3eral & ,erent !ormat" %"e& to nternall$ "tore&ata - th n the AS5677 an& Ser e" Ser3er". The metho& %"e&to repre"ent &ata nternall$ &epen&" %pon the t$pe o!proce"" n2 to 'e per!orme& on the &ata. The metho& %"e& to

    &e*ne n%mer c &ata al"o a,ect" the pro2ram9" e c enc$.F el&" can 'e cla"" *e& a"

    Type Description of Data

    A Alphanumeric (Character) Numeric

    S Zoned-decimal

    P Packed-decimal

    B Binary

    F Floating-point

    L Date

    ime

    Z ime!tamp

  • 8/9/2019 Physical File basics

    7/57

    Type Description of Data

    " "e#adecimal

    Onl$ the mo"t commonl$ %"e& &ata t$pe" are ll%"trate& nth " 'oo . Be!ore -e 'e2 n to con" &er the & ,erent &atat$pe"# e(am ne the recor& la$o%t !or the Emplo$ee Pa$ *lecalle& E PPAYPF n F 2%re 1.G. Th " recor& &e"cr pt on la$o%t

    " %"e& - th e(ample" thro%2ho%t th " 'oo .

    Figure 1.). *ecord description layout for Employee +ay leE,++A-+F.

    ALPHA8U ERIC CHARACTER/FIEL+SAn alphanumeric eld or character eld " a *el& thatconta n" an$ com' nat on o! letter"# & 2 t"# an& "pec alcharacter" "%ch a" # # # or K. S mpl$# an alphan%mer c*el& " a *el& that conta n" an$ pr nta'le character". In F 2%re1.G# the letter A n the T$pe col%mn &ent *e" alphan%mer c*el&". Th%"# the *r"t name# m &&le n t al# an& la"t name*el&" are &e*ne& a" alphan%mer c or character *el&".

    In th " !ormat a " n2le po" t on o! "tora2e# or '$te# " %"e& to"tore one character o! &ata. +ata &e*ne& a" an alphan%mer c

    character/ *el& cannot 'e %"e& n ar thmet c operat on"#e3en tho%2h the *el& ma$ conta n onl$ n%mer c & 2 t".

    Each '$te o! an alphan%mer c *el& " & 3 &e& nto t-oport on". The h 2hDor&er# 6D' t 0one port on an& the lo-D

    https://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#record_description_layout_for_emplohttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#record_description_layout_for_emplohttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#record_description_layout_for_emplohttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#record_description_layout_for_emplohttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#record_description_layout_for_emplohttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#record_description_layout_for_emplo
  • 8/9/2019 Physical File basics

    8/57

  • 8/9/2019 Physical File basics

    9/57

    A 0oned decimal eld "tore" one n%mer c & 2 t n each '$teo! "tora2e. F el&" "tore& n 0one& &ec mal !ormat can 'e %p to1= '$te" n len2th. In F 2%re 1.G# the letter S n the T$pecol%mn &ent *e" 0one& &ec mal *el&". The letter S mean"

    " 2ne n& cat n2 that the *el& conta n" a po" t 3e orne2at 3e " 2n. Th%"# the emplo$ee n%m'er# "tore n%m'er#an& &epartment n%m'er are 0one& &ec mal *el&".

    Internall$# the comp%ter "tore" character an& 0one& &ec mal*el&" n the "ame !ormat. Each '$te o! a 0one& &ec mal *el&

    " & 3 &e& nto t-o port on") the h 2hDor&er# 6D' t 0one port onan& the lo-Dor&er# 6D' t & 2 t port on.

    The !ollo- n2 "ho-" ho- a 1D'$te 0one& &ec mal *el&conta n n2 the 3al%e = " repre"ente& n EBC+IC)

    = 1111 7171

    e% /alue Binary /alue

    Zone Digit

    F &

    $$$$ %$%$

    1 '$te o! 0one& &ec mal &ata conta n n2 the n%mer c 3al%e =

    F 2%re 1.: ll%"trate" a =D'$te 0one& &ec mal *el& n -h cheach '$te repre"ent" one n%m'er or & 2 t. Th%"# t ta e" *3e'$te" to repre"ent the n%m'er ;:?== n 0one& &ec mal!ormat " nce ;:?== con" "t" o! *3e '$te".

    Figure 1. . oned decimal representation of the number ( 2&& /ebytes4.

    https://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#record_description_layout_for_emplohttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#zoned_decimal_representation_of_the_numbhttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#record_description_layout_for_emplohttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#zoned_decimal_representation_of_the_numb
  • 8/9/2019 Physical File basics

    10/57

    The lo-Dor&er or r 2htmo"t '$te o! a 0one& &ec mal *el&n& cate" -hether the *el& " po" t 3e or ne2at 3eM all other

    0one port on" n the *el& are 2nore&.

    The " 2n o! a 0one& &ec mal *el& can 'e repre"ente& a"po" t 3e or ne2at 3e a" "ho-n n F 2%re 1.< .

    Figure 1.5. *epresenting the sign of a 0oned decimal eld.

    For 0one& &ec mal *el&"# each '$te "tore" one & 2 t# -herethe 0one port on " e4% 3alent to Nall ' t" onN an& the & 2 tport on " the ' nar$ e4% 3alent o! one o! the &ec maln%m'er" 7 to

  • 8/9/2019 Physical File basics

    11/57

    T p

    +*6G*A,,!7G 8!+

    IB m &ran2e an& ma n!rame comp%ter" e(ec%te ar thmet coperat on" n pac e& &ec mal !ormat. There!ore# t " recommen&e&that n%mer c *el&" 'e n2 %"e& n ar thmet c operat on" 'e &e*ne& a"pac e& &ec mal !ormat. Th " "a3e" CPU t me -hen the ar thmet coperat on" are e(ec%te&.

    F el&" "tore& n pac e& &ec mal !ormat can 'e %p to e 2ht'$te" 1= & 2 t"/ n len2th. In the recor& &e"cr pt on n F 2%re1.G# the letter P n the T$pe col%mn &ent *e" pac e& &ec mal*el&". Th%"# the ho%rl$ rate# ho%r" -or e an& "ale" *el&"are &e*ne& a" pac e& &ec mal.

    Con" &er F 2%re 1.17 to compare 0one& &ec mal an& pac e&&ec mal !ormat" to "ee the re"%lt pac n2 ha" on a *el&.

    PAC I8 8U ERIC +ATA@hen a n%mer c *el& " pac e&)

    1. T-o n%mer c & 2 t" are "tore& n each '$te o! the pac e&&ec mal *el e(cept !or the r 2htmo"t '$te that al"oconta n" the " 2n.

    ?. The 3al%e" n the 0one an& & 2 t port on" o! the lo-Dor&er or r 2htmo"t '$te are "- tche&. Th " &e" 2nate"the *el& a" a pac e& *el&. The lo-Dor&er !o%r ' t" & 2 tport on/ o! the r 2htmo"t '$te o! a pac e& *el& conta n

    the " 2n F po" t 3e# + ne2at 3e/.>. All other 0one" are "tr ppe an& t-o & 2 t" are pac e&

    nto a " n2le '$te.

    Con" &er the n%m'er ;:?=6 n E(ample 1 o! F 2%re 1.17 .@hen a *3eD& 2 t n%m'er " "tore& n 0one& &ec mal !ormat tocc%p e" *3e "tora2e po" t on" or '$te". Ho-e3er# -hen"tore& n pac e& &ec mal !ormat# t occ%p e" three "tora2e

    po" t on" or '$te". Th " occ%r" 'eca%"e the 0one port on o!each '$te e(cept the r 2htmo"t one/ " remo3e there'$

    https://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#record_description_layout_for_emplohttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#record_description_layout_for_emplohttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#packing_of_zoned_decimal_fieldshttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#packing_of_zoned_decimal_fieldshttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#record_description_layout_for_emplohttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#record_description_layout_for_emplohttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#packing_of_zoned_decimal_fieldshttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#packing_of_zoned_decimal_fields
  • 8/9/2019 Physical File basics

    12/57

    perm tt n2 each '$te to hol& t-o & 2 t". The lo-Dor&er orr 2htmo"t '$te conta n" onl$ one & 2 t " nce t al"o conta n"the " 2n o! the *el&. In the 0one& &ec mal *el the NFN n the0one port on o! the r 2htmo"t '$te repre"ent" a po" t 3e " 2n.

    In the pac e& &ec mal *el the " 2n " place& n the & 2 tport on o! the r 2htmo"t '$te.

    @hen a *le conta n" a lar2e n%m'er o! n%mer c *el&"# %" n2the pac e& &ec mal !ormat "a3e" con" &era'le "pace an&tran"!er t me. For e(ample# ! a *el& con" "t n2 o! "e3en '$te"

    n 0one& &ec mal !ormat " con3erte& to pac e& &ec mal!ormat n a *le o! 177#777 recor&"# >77#777 '$te" o! & ""pace " "a3e&.

  • 8/9/2019 Physical File basics

    13/57

    Figure 1.19. +ac$ing of 0oned decimal elds.

    E(ample ? n F 2%re 1.17 ll%"trate" ho- a ne2at 3e n%m'er "repre"ente& n 0one& &ec mal an& pac e& &ec mal !ormat".8ot ce n 'oth !ormat" that the ne2at 3e " 2n " repre"ente&- th a he(a&ec mal 3al%e + 1171/. In the 0one& &ec mal*el the N+N n the 0one port on o! the r 2htmo"t '$terepre"ent" a

    https://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#packing_of_zoned_decimal_fieldshttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#packing_of_zoned_decimal_fields
  • 8/9/2019 Physical File basics

    14/57

  • 8/9/2019 Physical File basics

    15/57

    1. + 3 &e = '$ ?M ?.= " the 4%ot ent.

    ?. Ro%n& &o-n to ?.

    >. A&& 1.Re"%lt) Three '$te" are nee&e& !or the pac e& *el&.

    E%ample 2

    Con3ert a " (D& 2 t 0one& &ec mal *el& conta n n2 G=;? topac e& &ec mal !ormat)

    1. + 3 &e '$ ?M > " the 4%ot ent.

    ?. A&& 1.

    Re"%lt) Fo%r '$te" are nee&e& !or the pac e& *el&.

    7ote: S nce ; " an e3en n%m'er# the h 2hDor&er !o%r ' t" are0eroD*lle&. There!ore# t " 'e"t to &e*ne th " *el& a"conta n n2 "e3en & 2 t".

    CO8VERTI8 PAC E++ECI AL FOR AT TO O8E++ECI AL FOR AT@hen con3ert n2 a pac e& &ec mal *el& to a 0one& &ec mal*el comp%te a" !ollo-")

    1. %lt pl$ the n%m'er o! bytes n the pac e& &ec mal *el&'$ ?.

    ?. S%'tract 1 !rom the re"%lt o! the m%lt pl cat on.

    E%ample 1

    Con3ert a threeD'$te pac e& &ec mal *el& conta n n2 then%m'er = '$ ?.

  • 8/9/2019 Physical File basics

    16/57

    ?. S%'tract 1.

    Re"%lt) F 3e '$te" are nee&e& !or the 0one& &ec mal *el&.

    E%ample 2Con3ert a !o%rD'$te pac e& *el& conta n n2 the n%m'er

  • 8/9/2019 Physical File basics

    17/57

    Figure 1.11. ;ample data for one record in the Employee +ay leE,++A-+F.

    The act%al &ata recor& n F 2%re 1.1? "ho-" 'oth thehe(a&ec mal an& character repre"entat on" to repre"ent

    nternal EBC+IC co&e".

    Figure 1.12. e%adecimal and character representation.

    8ote the !ollo- n2)

    1. Blan " are repre"ente& a" he(a&ec mal 67. @hen a3al%e " "tore& n a character *el the %n%"e& port on "pa&&e& - th 'lan "# a" "ho-n n the *r"t an& la"t name*el&".

    ?. The ne2at 3e " 2n n the pac e& "ale" *el& "repre"ente& - th the 3al%e + n the lo-Dor&er po" t on o! the '$te po" t on ==/.

    >. E(am ne F 2%re 1.1? an& o'"er3e the %n%"%al characterrepre"entat on" n po" t on" 6: thro%2h ==. The"epo" t on" repre"ent three pac e& &ec mal *el&") theho%rl$ rate *el& n po" t on" 6:D=7# the ho%r" -or e&*el& n po" t on" =1D=?# an& the "ale" *el& n po" t on"=>Q==. The"e *el&" are pac e& *el&" an& conta n t-o& 2 t" per '$te e(cept !or the la"t '$te# -h ch conta n"the " 2n F po" t 3e or + ne2at 3e/. 8o 3al &

    character" are "ho-n !or the"e three *el&" " nce the

    https://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#hexadecimal_and_character_representationhttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#hexadecimal_and_character_representationhttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#hexadecimal_and_character_representationhttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#hexadecimal_and_character_representation
  • 8/9/2019 Physical File basics

    18/57

    n& 3 &%al '$te" conta n t-o & 2 t" an& th%" are notrepre"ente& '$ 3al & character".

    Let %" con" &er po" t on 6< to &eterm ne -h$ the character"

    are & "pla$e& th " -a$. The lo-erca"e letter p " n& cate& npo" t on 6

  • 8/9/2019 Physical File basics

    19/57

    T-o t$pe" o! &ata *le" can 'e &e*ne& on the "$"tem)ph$" cal *le" an& lo2 cal *le". A physical le " a *le thatact%all$ conta n" &ata recor&".

    The relat onal &ata'a"e al"o "%pport" the concept o! a 3 e-n the !orm o! a lo2 cal *le. A logical le " a *le that doesnot conta n &ata an& " 'a" call$ a %"er9" p ct%re or 3 e- o!the &ata'a"e. Lo2 cal *le" are co3ere& n &eta l n Chapter11 .

    ACCESS PATHSPh$" cal an& lo2 cal *le" %"e acce"" path" to acce"" recor&"n a *le. The access path " the metho& %"e& '$ theoperat n2 "$"tem to retr e3e np%t recor&" an& -r te o%tp%trecor&". The acce"" path ma$ 'e or2an 0e& a" arr 3al"e4%ence non e$e&/ or e$e& "e4%ence. Th%"# recor&" can'e rea& !rom or -r tten to a *le 'a"e& on) 1/ an arr 3al"e4%ence non e$e&/ acce"" path or ?/ a e$e& "e4%enceacce"" path. The acce"" path !or ph$" cal an& lo2 cal *le" ""tore& - th the act%al *le o' ect.

    HO@ +ATA ARE OR A8I E+A8+ RETRIEVE+ I8 A8ARRIVAL SE UE8CE

    8O8 EYE+/ PHYSICAL FILEAn arri/al se

  • 8/9/2019 Physical File basics

    20/57

    @hen ne- recor&" are a&&e& to a ph$" cal *le the$ are a&&e&to the en& o! the *le. Th " mean" that the or&er o! therecor&" n the ph$" cal *le " n no part c%lar "e4%ence.

    @ th acce"" n2 recor&" !rom an arr 3al "e4%ence *le# the$ areacce""e& "e4%ent all$. A "pec *c recor& can 'e acce""e& onl$a!ter *r"t acce"" n2 all recor&" that ph$" call$ prece&e t.

    That "# !or a pro2ram to rea& the

  • 8/9/2019 Physical File basics

    21/57

    accor& n2 to a e$ *el&. @hen creat n2 a e$e& *le# the"o!t-are &e3eloper m%"t &e" 2nate one or more e$ *el&"that uniquely &ent !$ each recor& n the *le. The e$ *el& or*el&" ma$ 'e locate& an$-here n the recor an& the$ &o

    not ha3e to 'e cont 2%o%" - th n the recor&. In a&& t on# thee$ *el& ma$ 'e e ther alphan%mer c or n%mer c. I! the *el&" n%mer c# t "ho%l& 'e &e*ne& a" 0one& &ec mal "o that

    -hen recor&" are & "pla$e& on the "creen n character !ormatthe e$ *el& - ll 'e rea&a'le.

    F 2%re 1.16 ll%"trate" ho- the Emplo$ee Pa$ *le appear" a" ae$e& "e4%ence *le. The Emplo$ee 8%m'er *el& " the e$

    *el& 'eca%"e t can 'e %"e& to %n 4%el$ &ent !$ each recor&.@hen a e$e& "e4%ence *le " create the "$"teme"ta'l "he" t-o *le" on & " )

    1. The data fle conta n n2 the act%al &ata recor&". @hen ae$e& *le " create the &ata *le " e"ta'l "he& on & "

    an& conta n" the ph$" cal &ata recor&" "tore& n the"e4%ence n -h ch the$ are a&&e& to the *le. In other-or&"# the recor&" are "tore& n e(actl$ the "amemanner a" arr 3al "e4%ence *le".

    ?. An index fle conta n n2 the e$ *el& an& a po nter *el&. The "$"tem %"e" the e$ *el& "pec *e& '$ the "o!t-are&e3eloper to e"ta'l "h the n&e( *le. The "$"tem %"e"the n&e( *le to ma nta n the correct "e4%ence o! therecor&" '$ "ort n2 the n&e( n or&er '$ the e$ *el&.

    The pointer feld - th n the n&e( conta n" the & "a&&re"" o! -here each recor& " ph$" call$ locate& n the&ata *le.

    https://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#structure_of_a_keyed_sequence_filehttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#structure_of_a_keyed_sequence_file
  • 8/9/2019 Physical File basics

    22/57

    Figure 1.1". ;tructure of a $eyed se

  • 8/9/2019 Physical File basics

    23/57

    ?. A po nter to the a""oc ate& &ata recor& n the &ata *le o! the e$e& "e4%ence *le.

    The *r"t *el& n each recor& o! the e$ *le or n&e( conta n"

    the 3al%e o! the e$ *el& o! the a""oc ate& recor& n the &ata*le. For a pa$roll *le# the e$ *el& ma$ 'e an emplo$een%m'er or Soc al Sec%r t$ n%m'erM !or an n3entor$ *le# the

    e$ *el& ma$ 'e pro&%ct n%m'erM !or an acco%nt" rece 3a'le*le# the e$ *el& ma$ 'e C%"tomer 8%m'er.

    The "econ& *el the pointer # " a *el& conta n n2 thelocat on act%al ph$" cal & " a&&re""/ o! the recor& n the&ata *le that " &ent *e& '$ the e$ *el&.

    @hen a ph$" cal *le " create e$ *el&" n&e(e"/ pro3 &ethe "e4%ence n -h ch recor&" are retr e3e& !rom the *le.@hen recor&" are a&&e& to a e$e& ph$" cal *le# the$ area&&e& to the en& o! the *le. At the "ame t me# the n&e( *le

    " %p&ate& - th a recor& conta n n2 the e$ *el& an& po nterthat conta n" the recor& a&&re"" o! that recor& n the &ata*le. The "$"tem place" the ne- n&e( recor&" n the r proper"orte& po" t on" n the n&e( *le" an& ma nta n" the proper

    or&er '$ e$ *el& re2ar&le"" o! the ph$" cal a&&re"" o! the& " recor&" n the &ata *le. Th " perm t" ran&om acce"" o!recor&" n the *le. So -h le the ph$" cal *le t"el! " n arr 3al"e4%ence# not n or&er '$ an$ "et o! *el& 3al%e"# the n&e(*le" e,ect 3el$ pro3 &e "%ch or&er n2".

    A" note the recor&" n the n&e( *le are "tore& an&ma nta ne& n "e4%ence accor& n2 to the e$ *el&. +%r n2proce"" n2# recor& retr e3al !rom the e$e& *le " per!orme&

    '$ the "$"tem %" n2 the e$ *le n a proce&%re that"completely transparent to the pro2ram. The &ata *le an&

    the n&e( *le ma$ 'e tho%2ht o! a" one *le.

    F 2%re 1.16 "ho-" ho- a pro2ram that &e*ne" the *le a" ae$e& *le -o%l& rece 3e the "ame 17 recor&"# ll%"trate&

    earl er !or the arr 3al "e4%ence *le. 8ote that the emplo$een%m'er" e$ *el&/ are ma nta ne& n "e4%ence - th n the

    e$ or n&e( *le.

    https://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#structure_of_a_keyed_sequence_filehttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#structure_of_a_keyed_sequence_file
  • 8/9/2019 Physical File basics

    24/57

    Unl e arr 3al "e4%ence# -here recor&" can onl$ 'e acce""e&"e4%ent all$# e$e& "e4%ence *le" allo- "e3eral metho&" o!*le acce"")

    1. Se4%ent all$ n arr 3al "e4%ence or&er *r"tD n# *r"tDo%t/'$ 2nor n2 the 3al%e" n the e$ *el&.

    ?. Se4%ent all$ n e$e& "e4%ence or&er 'a"e& on the3al%e o! the e$ *el&.

    >. Ran&oml$ n an$ "e4%ence 'a"e& on the 3al%e o! thee$ *el&.

    6. Ran&oml$ n an$ "e4%ence 'a"e& on the relat 3e recor&n%m'er.

    CREATI8 A PHYSICAL FILEF 2%re 1.1= ll%"trate" the proce&%re !or creat n2 a ph$" cal*le. Once the recor& &e"cr pt on la$o%t !or the ph$" cal *leha" 'een &eterm ne the !ormat o! the ph$" cal *le " -r ttenon +ata +e"cr pt on Spec *cat on" ++S/ !orm". The "o!t-are&e3eloper then %"e" CO+E5677 or another e& tor to enter the+ata +e"cr pt on Spec *cat on" nto a So%rce Ph$" cal F le#%"%all$ calle& ++SSRC. @hen &e*n n2 the ph$" cal *le tothe "$"tem# the ype *el& m%"t 'e "pec *e& a" PF!or p!ysical fle . In th " -a$# the "$"tem no-" -h ch t$pe o!o' ect to create -hen the "o%rce ++S " comp le&.

    https://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#procedure_for_creating_a_physical_file_ohttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#procedure_for_creating_a_physical_file_o
  • 8/9/2019 Physical File basics

    25/57

    Figure 1.1&. +rocedure for creating a physical le ob=ect.

    Once the "o%rce ++S are entere the Create Ph$" cal F leC" #$ / comman& " %"e& to comp le the "o%rce ++S nto a

    *le o' ect. Remem'er# a" - th all other o' ect"# the comp le&ph$" cal *le " "tore& n a l 'rar$. A!ter the *le " comp le&

    nto a *le o' ect# &ata can 'e entere& or mo& *e& n the *le.

    S nce PF " &e" 2nate& a" the T$pe -hen the "o%rce "entere the "$"tem no-" -hat t$pe o! o' ect to create-hen the ++S are comp le&. The "$"tem "tore" the *le&e"cr pt on an& recor& an& *el& attr '%te" - th the *le o' ect

  • 8/9/2019 Physical File basics

    26/57

    an& th%" can control -hat !%nct on" ma$ 'e per!orme& onthe *le o' ect.

    Once the ++S !or a ph$" cal *le " comp le& nto a *le o' ect#

    comp%ter pro2ram" can re!erence them. The recor& an& *el&attr '%te" o! a ph$" cal *le can 'e ncl%&e& & rectl$ nto apro2ram '$ &e*n n2 the *le a" an e(ternall$ &e"cr 'e& *le-here the recor& an& *el& &e*n t on" are "pec *e& e(ternalto the pro2ram.

    In "%mmar$# the "tep" !or creat n2 a ph$" cal *le are

    1. +eterm ne the recor& !ormat !or the ph$" cal *le.

    ?. @r te the +ata +e"cr pt on" Spec *cat on" ++S/ !or theph$" cal *le.

    >. Enter the ++S "o%rce mem'er %" n2 CO+E5677 or othere& tor.

    6. Comp le the ++S "o%rce mem'er nto a ph$" cal *leo' ect# correct n2 "$nta( error" -hen re4% re&.

    Let %" %"e a ca"e "t%&$ to con" &er each "tep n &eta l.

    CASE PROBLE ) CREATI8 APHYSICAL FILE

    The p%rpo"e o! th " ca"e pro'lem " to ll%"trate ho- to

    o Create an& enter ++S !or the Emplo$ee Pa$ *leE PPAYPF/ "o%rce mem'er.

    o Comp le the E PPAYPF "o%rce mem'er nto a *le o' ect.

    o U"e +FU to enter &ata nto the E PPAYPF ph$" cal *le.

    o + "pla$ the recor& content" o! the *le.

  • 8/9/2019 Physical File basics

    27/57

    +ETER I8E THE RECOR+FOR AT FOR THE PHYSICALFILEA ph$" cal *le conta n" onl$ one recor& !ormat - th each &atarecor& ha3 n2 the "ame recor& len2th# re!erre& to a" *(e&Dlen2th recor&"# an& conta n n2 the "ame *el&" n the "ameor&er.

    The recor& !ormat !or a ph$" cal *le m%"t 'e &eterm ne&

    'e!ore the act%al *le can 'e create&. Con" &er the recor&!ormat !or the Emplo$ee Pa$ *le n F 2%re 1.1; . Th " *le "%"e& to ll%"trate ho- to &e*ne arr 3al "e4%ence nonD e$e&/an& e$e& "e4%ence ph$" cal *le".

    Figure 1.1(. *ecord description layout for Employee +ay leE,++A-+F.

    +ATA +ESCRIPTIO8SPECIFICATIO8S ++S/ FOR A8ARRIVAL SE UE8CE FILEData Description ;peci cations "%ch a" tho"e n F 2%re1.1G &e*ne recor& !ormat" n ph$" cal an& lo2 cal *le". Th "

    ncl%&e" &e*n n2 the character "t c" o! *el&" ncl%& n2 *el&name"# " 0e o! *el&"# the t$pe o! &ata to 'e "tore& n the*el&"# 3al & 3al%e" that *el&" can conta n# an& "o on. In

    https://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#record_description_layout_for_emplo-id1https://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#data_description_specifications_forhttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#data_description_specifications_forhttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#record_description_layout_for_emplo-id1https://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#data_description_specifications_forhttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#data_description_specifications_for
  • 8/9/2019 Physical File basics

    28/57

    a&& t on# ++S can conta n col%mn hea& n2" an& other te(t%aln!ormat on# ran2e 'o%n&ar e" !or

    n%mer c *el&"# 3al & t$ chec n2 "pec *cat on"# an& other

    character "t c" or attr '%te" a'o%t the *el&".@hen "o%rce ++S are entere& !or a ph$" cal *le# the "o%rcet$pe m%"t 'e "pec *e& a" PF ph$" cal *le/. @hen the "o%rce++S are comp le& nto a *le o' ect# the comp%ter "$"tem

    no-" -hat t$pe o! o' ect to create !rom the t$pe PF"pec *cat on. In th " -a$# the acce"" path o! a ph$" cal *lealon2 - th the *le &e"cr pt on an& recor& an& *el& attr '%te"are "tore& - th the *le o' ect# n&epen&entl$ o! an$ pro2ram"

    that m 2ht %"e t. Th%"# -hen the *le o' ect " %"e the"$"tem no-" -h ch !%nct on" can 'e per!orme& on theo' ect 'a"e& on the o' ect9" t$pe o! PF.

    @hen a "o!t-are &e3eloper -ant" to acce"" a *le n apro2ram# re!erence to the e(ternal *le o' ect " "pec *e& nthe pro2ram. At pro2ram comp le t me# the "$"tem cop e" thepert nent n!ormat on a'o%t the *le an& *el&" !rom the *leo' ect nto the pro2ram an& comp le" t - th the re"t o! the

    pro2ram.Ph$" cal *le" are not &$nam c. I! the ++S !ormat o! a *le "chan2e the chan2e " not &$nam call$ &%pl cate& n all o!the pro2ram" that re!er to the *le. E3er$ pro2ram a,ecte& '$the chan2e "t ll nee&" to 'e recomp le&.

    Let %" con" &er the +ata +e"cr pt on Spec *cat on" !or theEmplo$ee Pa$ ph$" cal *le calle& E PPAYPF. F r"t# -e

    e(am ne the ++S n F 2%re 1.1G that &e*ne" the Emplo$eePa$ *le a" an arr 3al "e4%ence non e$e&/ ph$" cal *le. Then#-e & "c%"" the "pec *cat on" that are nece""ar$ to &e*ne the*le a" a e$e& *le.

    The recor& &e"cr pt on n a ph$" cal *le " calle& a recor&!ormat. A" note& earl er# there can 'e onl$ one recor& !ormat

    n a ph$" cal *le.

    https://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#data_description_specifications_forhttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#data_description_specifications_for
  • 8/9/2019 Physical File basics

    29/57

    Figure 1.1). Data Description ;peci cations for the arri/al se

  • 8/9/2019 Physical File basics

    30/57

    Each le3el o! the EMPPAYPF arr 3al "e4%ence ph$" cal *le "&e"cr 'e& 'elo-.

    File >e/el

    There are no *le le3el "pec *cat on" !or th " *le. F le le3el"pec *cat on" are "pec *e& *r"t 'e!ore the recor& !ormatle3el "pec *cat on".

    *ecord >e/el >ine (.994

    The &e"cr pt on o! the recor&" n a ph$" cal *le " calle&a record &ormat . There can 'e onl$ one recor& !ormat n aph$" cal *le.

    >ine (.99 ) Th " " the recor&D!ormat l ne that a"" 2n" a%n 4%e name to the recor& !ormat. The letter R "pec *e& nthe 8ame T$pe *el& po" t on 1G/ n& cate" that th " l ne "&e*n n2 the recor& !ormat name. The name o! therecor EMPPAYR # " le!tD %"t *e& n the 8ame *el& po" t on" 1e/el >ines ).99 1&.994

  • 8/9/2019 Physical File basics

    31/57

    >ine ).99 ) The Emplo$ee 8%m'er# calle& EMPLOYEENO # "le&t- 'ustifed n the 8ame *el& po" t on" 17Q>6/n& cate" that the *el& conta n" n ne & 2 t". The 7 rig!t-

    'ustifed n the +ec mal Po" t on" *el& po" t on" >;Q>G/n& cate" that the *el& ha" 0ero &ec mal po" t on".

    Remem'er# the n%m'er o! &ec mal po" t on" m%"t 'e entere&!or all n%mer c *el&" e3en ! the n%m'er o! &ec mal po" t on"

    " 0ero. @hen an entr$ " "pec *e& n the +ec mal Po" t on"*el the *el& " a%tomat call$ &e*ne& a" numeric . The&e!a%lt " that ! the &ec mal po" t on" entr$ " om tte that

    "# col%mn" >;Q>G are 'lan # the *el& " &e*ne& a"a c!aracter (alp!anumeric) *el&.

    The letter S n the +ata T$pe *el& po" t on >=/ n& cate" thatthe *el& " " 2ne& 0one&D&ec mal n%mer c. Th%"# the *el& - llocc%p$ n ne '$te" o! "tora2e n the recor&.

    A>!A; @ey ord ) Ph$" cal *le" allo- a &ata *el& to ha3e an

    alternat 3e ALIAS / name o! %p to >7 character". @henthe A>!A; e$-or& " %"e the ALIAS name#

    EP_EMPLOYEE_NUMBER n th " n"tance# " cop e& to the pro2ramn"tea& o! the *el& name EMPLOYEENO n the 8ame *el& po" t on"

    1

  • 8/9/2019 Physical File basics

    32/57

    I! the +ata T$pe *el& po" t on >=/ " blank an& the +ec malPo" t on" *el& po" t on" >;Q>G/ " 'lan # the &e!a%lt *el&t$pe " A !or alphan%mer c character/.

    I! the +ata T$pe *el& po" t on >=/ " blank an& the +ec malPo" t on" *el& po" t on" >;Q>G/ " not 'lan # that "# tconta n" a 3al & n%mer c n%m'er# then the &e!a%lt *el& t$pe

    " P !or pac e& &ec mal.

    T p

    +*6G*A,,!7G 8!+

    @e recommen& that a &ata t$pe 'e "pec *e& !or all *el&". Th " - llhelp no3 ce "o!t-are &e3eloper" n &e'%22 n2 the ++S " nce there- ll 'e no con!%" on a" to -hat the &ata t$pe reall$ ". Al"o#"pec !$ n2 the &ata t$pe pro3 &e" n"tant &oc%mentat on.

    >ine .99 ) The Store 8%m'er *el STORENO # " &e*ne& a" a 6D'$te 0one&D&ec mal *el& - th 0ero &ec mal po" t on". The 6 nthe Len2th *el& po" t on" >7Q>6/ n& cate" !o%r & 2 t" nlen2th an& the S n the +ata T$pe *el& po" t on >=/ n& cate"that the &ata t$pe " 0one& &ec mal n%mer c. Th%"# the *el&- ll occ%p$ !o%r '$e" n "tora2e. The 7 n the +ec malPo" t on" *el& po" t on" >;Q>G/ n& cate" 0ero &ec malpo" t on".

    The ALIAS name o! EP_STORE_NUMBER ha" 'een a"" 2ne& to th "*el&.

    >ine 5.99 ) The F r"t 8ame *el FIRSTNAME # " &e*ne& a" a 1=D'$te alphan%mer c character/ *el& A n +ata T$pe *elpo" t on >=/. An al a" name o! EP_FIRST_NAME " a"" 2ne& %" n2the ALIAS e$-or& n po" t on" 6=QG?.

    >ine 19.99 ) The &&le In t al *el MIDDLEINIT # " &e*ne& a" a1D'$te alphan%mer c *el& A n +ata T$pe *el po" t on >=/.An alternat 3e name o! EP_MIDDLE_INITIAL " a"" 2ne& %" n2 theALIAS e$-or&.

    >ine 11.99 ) The La"t 8ame *el LASTNAME # " &e*ne& a" a 1=D'$te alphan%mer c *el& A n +ata T$pe *el po" t on >=/. An

  • 8/9/2019 Physical File basics

    33/57

    alternat 3e name o! EP_LAST_NAME " a"" 2ne& %" n2the ALIAS e$-or&.

    >ine 12.99 ) The +epartment *el DEPARTMENT # " &e*ne& a" a

    three & 2 t 0one& &ec mal *el& S n +ata T$pe *el po" t on>=/ - th no &ec mal po" t on". An alternat 3e name o!EP +EPART E8T " a"" 2ne& %" n2 the ALIAS e$-or&.

    >ine 13.99 ) The Ho%rl$ Rate *el HOURLYRATE# " &e*ne&a" a *3eD& 2 t pac e& *el& - th t-o &ec mal" ? n the+ec mal Po" t on" *el po" t on" >;Q>G/. The letter P n the+ata T$pe *el& po" t on >=/ n& cate" that the &ata t$pe "pac e& &ec mal. An alternat 3e name o! EP HOURLY RATE "

    a"" 2ne& %" n2 the ALIAS e$-or&.Altho%2h th " *el& " &e*ne& a" pac e& &ec mal# the%npac e& " 0e o! the *el& " "pec *e& n the Len2th *el&. TheHOURLYRATE *el& - ll hol& *3e & 2 t"

    '%t " pac e& nto three '$te" o! "tora2e n the recor&. Th%"#the ho%rl$ rate *el& " "tore& n po" t on" 6: thro%2h =7 o!the recor&.

    I! the ho%rl$ rate o! an emplo$ee " ?:.6=# then 7 " place& nthe le!tmo"t or h 2hDor&er po" t on o! the *el&. Th%"# ! theho%rl$ rate " ?:.67# the rate " "tore& a" 7?:6= an&

    nterprete& a" 7?:.6=. 8%mer c &ata " al-a$" r 2htD %"t *e&n th " -a$.

    The &ec mal po nt " not "tore& n the recor& - th the &ata#" nce t -o%l& -a"te a "tora2e po" t on. @e - ll "ee that

    COBOL %"e" mpl e& &ec mal po nt"# repre"ente& a" the letterV# to &e*ne n%m'er" - th &ec mal component".

    >ine 1".99 ) The Ho%r" @or e& *el HRS@OR E+# " &e*ne&a" a threeD& 2 t pac e& *el& - th one &ec mal 1 n the+ec mal Po" t on" *el po" t on" >;Q>G/. The letter P n the+ata T$pe *el& po" t on >=/ n& cate" that the &ata t$pe "pac e& &ec mal. An alternat 3e name o! EP HOURS @OR E+

    " a"" 2ne& %" n2 the ALIAS e$-or&.

  • 8/9/2019 Physical File basics

    34/57

    >ine 1&.99 ) The Sale" *el SALES# " &e*ne& a" a *3eD& 2 tpac e& *el& - th 0ero &ec mal" 7 n the +ec mal Po" t on"*el po" t on" >;Q>G/. The letter P n the +ata T$pe *el&

    po" t on >=/ n& cate" that the &ata t$pe " pac e& &ec mal.

    An alternat 3e name o! EP SALES " a"" 2ne& %" n2 the ALIASe$-or&.

    ++S FOR A EYE+ SE UE8CEFILEFor e$e& "e4%ence *le"# the or&er n -h ch recor&" are

    retr e3e& !rom the *le " 'a"e& on the content" o! the e$*el&" &e*ne& n the ++S. e$e& "e4%ence allo-" & rectacce"" to a recor& n a *le thro%2h the 3al%e o! t" e$ *el&"an& perm t" the "e4%ent al retr e3al o! the recor&" o! a *leaccor& n2 to the 3al%e" o! the e$ *el&". Let %" con" &er the+ata +e"cr pt on Spec *cat on" ++S/ that are nece""ar$ to&e*ne the Emplo$ee Pa$ *le a" a e$e& *le. F 2%re1.1: "ho-" the ++S "o%rce !or the E PPAYPF ph$" cal *le&e"cr 'e& a" a e$e& *le. There are t-o a&& t onal entr e"nece""ar$ to &e*ne th " *le a" a e$e& *le. Both areh 2hl 2hte& n 'ol an& a &e"cr pt on o! the a&& t onal entr e"nece""ar$ !or e$e& "e4%ence *le" !ollo-" the *2%re.

    Figure 1.1 . Data Description ;peci cations for the $eyed see/el >ine (.994

    https://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#data_description_specifications_for-id1https://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#data_description_specifications_for-id1https://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#data_description_specifications_for-id1https://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#data_description_specifications_for-id1
  • 8/9/2019 Physical File basics

    35/57

    >ine (.99 ) The *le le3el e$-or& U8I UE "pec *e& n thee$-or& *el& po" t on" 6=Q:7/ n& cate" that the e$ *el

    Emplo$ee 8%m'er# " %n 4%e - th n the recor&". Th " mean"that e3er$ emplo$ee n%m'er - th n the *le conta n" a

    & ,erent 3al%e. A r%nDt me error - ll occ%r ! a pro2ram tr e"to a&& a recor& to the *le - th a 3al%e n the Emplo$ee8%m'er *el& that " e4%al to the Emplo$ee 8%m'er o! ane( "t n2 recor&.

    Th " l ne &oe" not tell the "$"tem -h ch *el& " the e$ *el&.It %"t "tate" that the e$ *el& m%"t 'e %n 4%e !or eachrecor&. I! U8I UE -ere om tte& !or a e$e& "e4%ence *le#&%pl cate e$" -o%l& 'e allo-e&. Th " mean" that the *leco%l& conta n "e3eral recor&" n -h ch the Emplo$ee 8%m'er*el& conta ne& the "ame 3al%e# th%" ma n2 t mpo"" 'le to%n 4%el$ &ent !$ a "pec *c recor&.

    @ey Field >e/el >ine 1).994

    The e$ *el& le3el o! the ++S m%"t !ollo- the *el& le3el.

    >ine 1).99 ) The letter n the 8ame T$pe *el& po" t on 1G/

    n& cate" that the *el& "pec *e& n the 8ame *el& po" t on"1

  • 8/9/2019 Physical File basics

    36/57

    h 2hDor&er e$ or pr mar$ "ort *el& an& the la"t e$ *el&l "te& " the lo-Dor&er "ort *el&.

    To -r te pro2ram" that acce"" the Emplo$ee Pa$ *le# $o%

    nee& to re!er to the ++S o! the ph$" cal *le E PPAYPF "o $o%can %"e the correct *el& name" n &e"cr ' n2 the o%tp%treport *le. The ALIAS name" are a"" 2ne& to the *el&" n the++S to "tan&ar& 0e name" !or the *el&" n th " *le an& are%"e& !or all pro2ram" that acce"" th " *le a" an e(ternall$&e"cr 'e& *le. The pre*( EPD Emplo$ee Pa$/ " %"e& to

    n& cate that the"e *el&" are part o! the Emplo$ee Pa$ F le.

    CO PILE SOURCE ++S I8TO AFILE OBJECTCreat n2 the "o%rce ++S !or a *le &oe" not create the act%al*le. E(ec%t n2 the Create comman& CRTPF CReaTe Ph$" calF le/ create" a ph$" cal *le o' ect FILE/.

    The CRTPF comman& - ll n3o e the comp ler that - ll n"pect

    the ++S "o%rce "tatement" !or correct "$nta(. I! the ++S&oe" not conta n an$ error"# a l "t n2 o! the *le la$o%t "pr nte& an& the *le o' ect create&.

    I! error" are !o%n the comp ler - ll pro&%ce a l "t n2 o! the++S "o%rce alon2 - th a &e"cr pt on o! the error". The error"m%"t 'e correcte& n the "o%rce ++S an& the CRTPFcomman& r%n a2a n. Th " c$cle m%"t 'e repeate& %nt l allerror" ha3e 'een correcte& an& the CRTPF comman&

    pro&%ce" a *le o' ect !rom the "o%rce ++S.@hen the CRTPF comman& " "%'m tte the "$"tem chec "to "ee ! a *le alrea&$ e( "t" n the l 'rar$ "pec *e& n theCRTPF comman&. I! a *le e( "t"# the

    "$"tem - ll prompt - th a re4%e"t to &elete the ol& o' ect. I!$o% re"pon& - th Y !or $e"# the ol& o' ect " &elete& an& theCRTPF comman& create" a ne- o' ect. In &o n2 "o# all &ata n

    the ol& *le o' ect are &elete&. Th%"# t " mportant toremem'er that ! a ph$" cal *le e( "t" an& &ata ha3e 'een

  • 8/9/2019 Physical File basics

    37/57

    entere& nto the *le# the &ata - ll 'e lo"t ! a "o!t-are&e3eloper chan2e" the "o%rce ++S an& recomp le" the &ata

    nto a ne- o' ect. To pre3ent th " !rom happen n2# %"e theCH PF comman& & "c%""e& later n th " chapter. Al"o# the

    &ata co%l& 'e cop e& to a *le o! a & ,erent name 'e!ore thene- o' ect " create&. Then# the &ata can 'e cop e& 'ac tothe ne- o' ect a!ter the Create comman& " r%n. Remem'erto e(erc "e ca%t on -hen recomp l n2 "o%rce ++S !or aph$" cal *le that alrea&$ conta n" &ata.

    The Create comman& that create" the ph$" cal *le !or theE PPAYPF *le ")

    CRTPF FILE (userLIB/EMPPAYPF) SRCFILE (userLIB/QDDSSRC)SRCMBR (*FILE) TEXT ('Employee Pay File')

    The FILE parameter "%ppl e" the name o! the ph$" cal *lethat " 'e n2 create& an& the l 'rar$ n -h ch t - ll 'e "tore&.In th " e(ample# the ph$" cal *le E PPAYPF " create& n%"erLIB# -here %"erLIB " $o%r l 'rar$. The SRCFILE So%rceF le/ parameter "%ppl e" the locat on o! the mem'erconta n n2 the ++S "o%rce. In th " e(ample# the "$"tem - ll

    "earch the ++SSRC "o%rce ph$" cal *le n %"erLIB !or the++S "o%rce. The TE T parameter pro3 &e" a metho& o!pro3 & n2 %p to =7 character" o! &e"cr pt 3e te(t a'o%t the*le.

    The "o%rce ++S can al"o 'e comp le& nto a *le o' ect !romthe P+ @or - th em'er" "creen. Once the "o%rce ++Sare complete& an& "a3e opt on 16 can 'e entere& n theOpt on col%mn 'e" &e the name o! the ++S $o% - "h to

    comp le nto an o' ect. Opt on 16 - ll ca%"e the "$"tem tocreate the CRTPF comman& !or $o% an& "%'m t the comman&to 'atch.

    +ISPLAYI8 THE FIEL+ATTRIBUTES OF A PHYSICAL

    FILE

  • 8/9/2019 Physical File basics

    38/57

    The Display File Field Description D;+FFD / comman& "%"e& to & "pla$ the &e"cr pt on o! the *le an& attr '%te" o!the recor& !ormat an& *el&" conta ne& n the recor& !ormat.

    To e(ec%te th " comman&

    1. Enter D;+FFD on an$ comman& l ne.

    ?. #ress F" !or the *llD nDtheD'lan " prompt "creen.

    >. Enter E,++A-+F n the F le *el& an& user>!B n theL 'rar$ *el -here user>!B " $o%r l 'rar$ name.

    6. #ress Enter .

    The + "pla$ F le F el& +e"cr pt on comman& & "pla$" "e3eral"creen" conta n n2 n!ormat on relat n2 to the *le# recor&!ormat# an& *el&". F 2%re 1.1< pro3 &e" th " n!ormat on a'o%tthe E PPAYPF *le. The "creen" & "pla$e& '$ the +SPFF+ha3e 'een 2ro%pe& here !or rea&a' l t$.

    Figure 1.15. *esults of e%ecuting the Display File Field DescriptionD;+FFD4 command on the E,++A-+F le.

    https://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#results_of_executing_the_displayhttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#results_of_executing_the_display
  • 8/9/2019 Physical File basics

    39/57

    Figure 1.15. *esults of e%ecuting the Display File Field DescriptionD;+FFD4 command on the E,++A-+F le conCt.

    E8TERI8 +ATA I8TO APHYSICAL FILE @ITH +FUIn t all$# a!ter the "o%rce ++S !or a ph$" cal *le ha3e 'eencreate& an& comp le& nto a *le o' ect# the *le - ll notconta n an$ recor&". In other -or&"# the *le e( "t" a" ano' ect - th a *le &e"cr pt on an& recor& an& *el& attr '%te"'%t no &ata recor&".

    There are man$ metho&" '$ -h ch &ata recor&" can 'eentere& nto a ph$" cal *le. For e(ample# comp%ter pro2ram"can a&& recor&" to a ph$" cal *le# a" -e - ll "ee later n the'oo . For no-# let %" con" &er ho- -e m 2ht 2et recor&" ntothe E PPAYPF *le "o -e can r%n an& te"t o%r pro2ram".

    +ata F le Ut l t$ +FU/ " an IB %t l t$ pro&%ct that pro3 &e"one metho& o! enter n2 te"t &ata nto a ph$" cal *le. +FU ha""e3eral opt on" !or ma nta n n2 ph$" cal *le". @e - ll con" &er

  • 8/9/2019 Physical File basics

    40/57

    onl$ the +FU opt on that allo-" the temporar$ %p&ate o! aph$" cal *le.

    To %"e +FU to enter the &ata n F 2%re 1.?7 nto the E PPAYPF

    ph$" cal *le# complete the !ollo- n2 "tep")1. Enter ;8*DF on a comman& l ne

    ?. #ress Enter .

    >. Enter the n%m'er = to "elect opt on =# Up&ate &ata%" n2 temporar$ pro2ram.

    6. Enter emppaypf nto the +ata *le *el&

    =. Enter user>!B nto the L 'rar$ *el -here %"erLIB "$o%r l 'rar$.

    ;. #ress Enter .

    +FU - ll create a temporar$ pro2ram that allo-" &ata to 'eentere& nto the "pec *e& *le. Th " temporar$ pro2ram "create& %" n2 the attr '%te" "tore& - th the "pec *e& *leo' ect. +ata recor&" can no- 'e entere&.

    https://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#data_for_the_emppaypf_data_filehttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#data_for_the_emppaypf_data_file
  • 8/9/2019 Physical File basics

    41/57

  • 8/9/2019 Physical File basics

    42/57

    Figure 1.29. Data for the E,++A-+F data le.

    +ISPLAYI8 THE CO8TE8TSOF PHYSICAL FILE RECOR+SA!ter the &ata ha3e 'een entere& nto the ph$" cal *le# therecor&" ma$ 'e & "pla$e& to con*rm the content" o! the *le.One metho& to accompl "h th " " - th the Display +hysicalFile ,ember D;++F,4 comman&. To e(ec%te the +SPPFcomman&

    1. Enter D;++F, on an$ comman& l ne.

    ?. #ress F" !or the *llD nDtheD'lan " prompt "creen.

    >. Enter E,++A-+F n the F le *el& an& user>!B n theL 'rar$ *el -here %"erLIB " $o%r l 'rar$ name.

    6. #ress Enter .

    F 2%re 1.?1 "ho-" the re"%lt o! e(ec%t n2 the +SPPF !or the

    E PPAYPF *le. 8ote that the pac e& *el&" n po" t on" 6:thro%2h == are %nrea&a'le. Th " " 'eca%"e each '$tecon" "t" o! t-o & 2 t" o! &ata that cannot 'e tran"late& ntocharacter or he(a&ec mal !orm.

    PRI8TI8 OR +ISPLAYI8RECOR+S @ITH THE COPY FILE

    CPYF/ CO A8+Another metho& that can 'e %"e& to & "pla$ the recor&" o! a*le " the opy File +-F4 comman&. One a&3anta2e o!th " comman& " that each recor& " & "pla$e& - th 'oth thecharacter an& he(a&ec mal repre"entat on". To e(ec%te theCPYF comman&

    1. Enter +-F on an$ comman& l ne.

    https://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#results_of_executing_the_dsppfm_commandhttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#results_of_executing_the_dsppfm_command
  • 8/9/2019 Physical File basics

    43/57

    ?. #ress F" !or the *llD nDtheD'lan " prompt "creen.

    >. F llD n the *el&" a" !ollo-")

    1. Enter E,++A-+F n the From *le *el&.?. #ress Field E%it or 8ab .

    >. Enter user>!B n the L 'rar$ *el -here %"erLIB "$o% l 'rar$ name.

    6. #ress Field E%it or 8ab .

    =. Enter +*!78 n the To *le *el& "o that $o% canpr nt or & "pla$ the o%tp%t o! the comman&.

    ;. #ress 8ab ;!? times .

    G. Enter E? n the Pr nt !ormat *el& "o thatcharacter an& he(a&ec mal 3al%e" are & "pla$e&.

    :. #ress Field E%it to e( t !rom the Pr nt !ormat *el&an& clear the rema n&er o! the *el&.

    6. #ress Enter .

    Once the CPYF comman& ha" 'een complete $o% nee& toloo at the "pool *le !or the o%tp%t.

    1. Enter *@6 8 user6 8 on an$ comman& l ne#-here %"erOUT " $o%r o%tp%t 4%e%e.

    ?. Enter = n the Opt on col%mn 'e" &e the "pool *le !romth " CPYF comman&.

    >. #ress Enter .

    F 2%re 1.?? "ho-" the re"%lt o! e(ec%t n2 the CPYF !or theE PPAYPF *le. A" n the +SPPF comman the pac e& *el&"are not rea&a'le n character !ormat. The he(a&ec mal 3al%e

    n& cate" the act%al 3al%e" "tore& n all *el&"# ncl%& n2 thepac e& *el&". Un&er"tan& n2 ho- to rea& the he(a&ec mal3al%e" can 'e o! 2reat a"" "tance -hen &e'%22 n2 pro2ram"

    https://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#results_of_executing_the_cpyf_command_onhttps://www.safaribooksonline.com/library/view/programming-in-cobol400/9780471418467/ch01.html#results_of_executing_the_cpyf_command_on
  • 8/9/2019 Physical File basics

    44/57

    that chan2e or %p&ate &ata recor&" n a *le. I! $o% nee& to3er !$ the act%al 3al%e" o! &ata n a *le# e"pec all$ pac e&&ec mal *el&"# & "pla$ n2 the he(a&ec mal 3al%e - ll tell $o%the 3al%e" o! all *el&". Al"o# the he(a&ec mal 3al%e " one o!

    the 'e"t -a$" to 3er !$ that a ne2at 3e n%mer c pac e&&ec mal *el& conta n" a ne2at 3e " 2n. Recor&" that conta nne2at 3e Sale" - ll conta n a + ne2at 3e/ !or the " 2n n thelo-Dor&er r 2htmo"t '$te.

    8ote that the recor&" are & "pla$e& n e$e& "e4%ence. TheRC+8BR *el& n& cate" the ph$" cal locat on o! the recor& nthe &ata *le.

    Figure 1.21. *esults of e%ecuting the D;++F, command on theE,++A-+F le.

  • 8/9/2019 Physical File basics

    45/57

    Figure 1.22. *esults of e%ecuting the +-F command on theE,++A-+F.

    USI8 THE CHA8 E PHYSICALFILE CH PF/ CO A8+

    There are t me" -hen a!ter a ph$" cal *le " create& an& &ata

    ha3e 'een entere the "o!t-are &e3eloper real 0e" that achan2e to the ph$" cal *le " nece""ar$. S%ch chan2e" co%l&ncl%&e chan2 n2 the " 0e o! a *el& or a&& n2 a ne- *el& to

    the ph$" cal *le. For e(ample# a per"onnel *le conta n n2&ata a'o%t the emplo$ee" co%l& 'e n pro&%ct on !or man$$ear" -hen the per"onnel mana2er &ec &e" to a&& a ne-&e&%ct on *el& !or the emplo$ee " c !%n&. In th " ca"e# the++S !or the per"onnel *le nee&" to 'e chan2e& - tho%ta,ect n2 the e( "t n2 &ata n the *le.

    @hen the "tr%ct%re o! a ph$" cal *le chan2e"#the G+F hange +hysical File / comman& " %"e& torecomp le the *le - tho%t loo" n2 the &ata that are c%rrentl$"tore& n the &ata *le. The CH PF comman& "a3e" theor 2 nal &ata an& tran"!er" the &ata to the ne- *le. Ina&& t on# lo2 cal *le" are recomp le& 'a"e& on the ne-l$mo& *e& ph$" cal *le. To ll%"trate th "# let %" con" &er o%rEmplo$ee Pa$ *le.

  • 8/9/2019 Physical File basics

    46/57

    In the or 2 nal ++S !or the Emplo$ee Pa$ F le n F 2%re 1.?> #the compan$ allo-" !or "ale" %p to '%t not ncl%& n2 oneh%n&re& tho%"an& &ollar"

  • 8/9/2019 Physical File basics

    47/57

    Figure 1.2". 7e DD; for Employee +ay le.

    To chan2e the E PPAYPF *le la$o%t# the !ollo- n2 CLcomman& " e(ec%te&)

    C"'PF F L C*B*L+DL B, PPA.PF)

    S/CF L (C*B*L+DL B,0DDSS/C)

    S/C B/( PPA.PF)

    DL D PLF (1. S)

    @hen the ++S are chan2e& to re&%ce a *el&9" " 0e or toremo3e a *el& an& the CH PF comman& " e(ec%te the"$"tem "en&" the !ollo- n2 error me""a2e)

    CPA32B2 Change of file EMPPAYPF may cause data to be lost (C I)

    Th " me""a2e appear" 'eca%"e the ho%rl$ rate an& ho%r"-or e& *el&" are not ncl%&e& n the ne- ++S. Enter n2 I

    I2nore/ tell" the "$"tem to cont n%e e(ec%t n2 the CH PFcomman&. @hen the CH PF comman& complete"# theEmplo$ee Pa$ *le E PPAYPF ha" the ne- !ormat an& the &ataha3e 'een cop e& to t. The &ata are cop e& '$ *el& name.

    The +LT+EPLF parameter " "pec *e& "o that all &epen&e&lo2 cal *le o' ect" are &elete& 'e!ore the ph$" cal *le "recomp le&.

  • 8/9/2019 Physical File basics

    48/57

    There are "ome th n2" to remem'er a'o%t the CH PFcomman&)

    o I! the name o! a *el& " chan2e that *el&9" &ata are not

    reta ne& n the ne- *le.o 8e- *el&" are loa&e& - th a &e!a%lt 3al%e. 8%mer c

    *el&" &e!a%lt to 0ero# an& alphan%mer c *el&" &e!a%lt to"pace".

    o A *el&9" &ata t$pe cannot 'e chan2e&. I! a *el&9" &atat$pe " chan2e an error me""a2e CP+>?CB F el&

    cannot 'e chan2e& !or *le

    n ./ " & "pla$e an& the CH PFterm nate".

    Chan2 n2 a *le9" recor& la$o%t &oe" not & rectl$ a,ect thepro2ram" %" n2 the *le. All pro2ram" acce"" n2 the *le m%"t'e recomp le& 'e!ore the$ can acce"" the ne- 3er" on o! the*le. I! a pro2ram tr e" to acce"" the ne- *le 'e!ore t "comp le the "$"tem ""%e" an error that n& cate" therecor& !ormat o! the *le " not the "ame a" -hen the pro2ram

    -a" or 2 nall$ comp le&.7ote ) It " 2oo& pract ce to ma e a 'ac %p cop$ o! a &ata *le'e!ore chan2 n2 t" recor& la$o%t. I! !or "ome rea"on"ometh n2 2oe" -ron2 an& the &ata *le " lo"t# the *le can 'ereco3ere& !rom the 'ac %p cop$. 8e3er r " lo" n2 &ata.

    E8+DOFDCHAPTER AI+SCHAPTER SU ARY

    The mo"t commonl$ %"e& &ata t$pe" %"e& on Ser e" Ser3er"are

    Data Type Characteristics Types Of Data

    Alphanumeric(Character) (A)

    Store! one character in each 2yte o3 the 3ield4 Can contain anyletter!5 digit!5 an

  • 8/9/2019 Physical File basics

    49/57

    Data Type Characteristics Types Of Data

    character! !uch a

    Numeric: Can contain the nthrough ; only4

    Signed ZonedDecimal (S)

    Store! one numeric digit in each 2yte4 he !igno3 the 3ield i! !tored in the lo

  • 8/9/2019 Physical File basics

    50/57

    Acce"" path

    ALIAS

    Arr 3al "e4%enceCop$ F le CPYF/

    +ata +e"cr pt on Spec *cat on"

    ++S/

    +ata F le Ut l t$ +FU/

    +B?5677

    + "pla$ F le F el& +e"cr pt on +SPFF+/

    + "pla$ Ph$" cal F le em'er +SPPF /

    E(ternall$ &e"cr 'e& *le"

    In&e(

    e$ *el&

    e$ *le

    e$e& "e4%ence

    Lo2 cal *le

    Ph$" cal *le PF/

    Po nter

    Pro2ramD&e"cr 'e& *le"

    Relat onal &ata'a"e mo&el

    CHAPTER SELFDTEST TRUEDFALSE UESTIO8S

  • 8/9/2019 Physical File basics

    51/57

    o 1. The &ata'a"e mana2ement "$"tem %"e& on theSer e" Ser3er an& AS5677 " the relat onal &ata'a"e

    mo&el.

    o ?. The Ser e" Ser3er %"e" the ASC II co& n2 "$"tem !ornternal ' nar$ repre"entat on.

    o >. Recor&" can 'e retr e3e& !rom an arr 3al "e4%ence *le'$ %" n2 the a"" 2ne& e$ *el&.

    o 6. @hen creat n2 a ph$" cal *le# the T$pe *el& m%"t 'e"pec *e& a" PF.

    o =. +ata +e"cr pt on Spec *cat on" are %"e& to &e*neph$" cal *le".

    o ;. I! the len2th o! a pac e& *el& " "pec *e& a" < on the++S# the *el& - ll occ%p$ n ne '$te" o! "tora2e.

    o G. The +SPFF+ comman& " %"e& to 3 e- the &ata n aph$" cal *le.

    o

    :. The +SPPF comman& & "pla$" the attr '%te" o! a*le.

    o

  • 8/9/2019 Physical File basics

    52/57

    6. A &ata'a"e " a collect on o! *le" !or a 2 3enappl cat on that can 'e .

    =. The Ser e" Ser3er an& AS5677 %"e the &ata'a"e

    mo&el calle& .;. In a n/ arr 3al "e4%ence5 e$e&/ *le# the recor&" are

    proce""e& n a *r"tD n# *r"tDo%t "e4%ence.

    G. In a n/ arr 3al "e4%ence5 e$e&/ *le# recor&" can 'eacce""e& accor& n2 to a "pec *c *el& "/.

    :. A lo2 cal5ph$" cal/ *le conta n" &ata.

    . E(pla n the p%rpo"e o! the ++S ALIAS e$-or&.

  • 8/9/2019 Physical File basics

    53/57

    PRO RA I8 ASSI 8 E8TS1. U" n2 the !ollo- n2 pro'lem &e*n t on

    1. Create the ++S !or the C%"tomer Tran"act on F le.

    ?. U"e +FU to enter "ample te"t &ata nto the *le.

    *ecord Description >ayout for customertransaction le

    Field Description Type Size COBOL Field-nam

    Fir!t Name A ; C -F /S -NA

    iddle nitial A $ C - DDL - N

    La!t Name A $& C -LAS -NA

    Date o3 ran!action ( ,D,..) L $% C -DA -*F- /A

    ran!action Amount P =5+ C - /ANSAC *N

    ?. U" n2 the !ollo- n2 pro'lem &e*n t on

    1. Create the ++S !or the Pa$roll Salar$ F le name&PAYSALPF.

    ?. U"e +FU to enter "ample te"t &ata nto the *le.

    *ecord Description >ayout for payroll salary le

    Field Description Type Size COBOL Field-namemployee Num2er (?) S &5% PS- PL*. -N> B

    mployee La!t Name A +% PS- PL*. -LAS -NA

    mployee Fir!t Name A $+ PS- PL*. -F /S -N

    erritory Num2er S +5% PS- // */.-N> B

    *33ice Num2er S +5% PS-*FF C -N> B /

  • 8/9/2019 Physical File basics

    54/57

    Field Description Type Size COBOL Field-name

    Annual Salary P =5% PS-ANN>AL-SALA/.

    Social Security Num2er S ;5% PS-S*C AL-S C>/ .-N

    >. U" n2 the !ollo- n2 pro'lem &e*n t on

    1. Create the ++S !or the C%"tomer A&&re"" F lename& CSTA++PF.

    ?. U"e +FU to enter "ample te"t &ata nto the *le.

    *ecord Description >ayout for customer addressle

    Field Description Type Size COBOL Field-name

    Cu!tomer Fir!t Name A $& CA-C>S * /-F /S -N

    Cu!tomer iddle nitial A $ CA-C>S * /- DDL

    Cu!tomer La!t Name A +% CA-C>S * /-LAS -N

    Street Addre!! A +% CA-S / -ADD/ SS

    City A $& CA-C .

    State A + CA-S A

    Zip Code S &5% CA-Z P-C*D

    6. U" n2 the !ollo- n2 pro'lem &e*n t on

    1. Create the ++S !or the C%"tomer U"a2e F le name&CSTUS PF.

    ?. U"e +FU to enter "ample te"t &ata nto the *le.

    *ecord Description >ayout for customer usage le

  • 8/9/2019 Physical File basics

    55/57

    Field Description Type Size COBOL Field-n

    Account Num2er (?) S &5% C>-ACC*>N -N

    Fir!t Name A $% C>-F /S -NA

    La!t Name A $& C>-LAS -NA

    Street Addre!! A +% C>-S / -AD

    ?ilo/S-*F-

    'a! >!ed P &5% C>-'AS->S D

    lectricity Bill P &5+ C>- L C / C

    People who finished this also enjoyed:

    BOOK SECTION

    Storytelling and Narrative from: The Persona ife!y!le: Keeping

    People in "ind Thro#gho#t Prod#!t $esign %y Tamara &dlin''' Released: April2006

    () "INS

    o

    B#siness

    o B#siness Comm#ni!ation

    o $igital "edia

    BOOK SECTION

    https://www.safaribooksonline.com/library/view/the-persona-lifecycle/9780125662512/ch09.htmlhttps://www.safaribooksonline.com/library/view/the-persona-lifecycle/9780125662512/https://www.safaribooksonline.com/library/view/the-persona-lifecycle/9780125662512/https://www.safaribooksonline.com/t/business/https://www.safaribooksonline.com/t/business-communication/https://www.safaribooksonline.com/t/digital-media/https://www.safaribooksonline.com/library/view/the-persona-lifecycle/9780125662512/ch09.htmlhttps://www.safaribooksonline.com/library/view/the-persona-lifecycle/9780125662512/https://www.safaribooksonline.com/library/view/the-persona-lifecycle/9780125662512/https://www.safaribooksonline.com/t/business/https://www.safaribooksonline.com/t/business-communication/https://www.safaribooksonline.com/t/digital-media/
  • 8/9/2019 Physical File basics

    56/57

    Prefa!e to the *o#rth Edition from: The "odern +P, I-

    ang#age. *o#rth Edition %y +o%ert Co//i Released: September 2006

    0 "INS

    o $ata%ases

    BOOK SECTION

    Introd#!tion from: 1i2is *or $#mmies3 %y $an

    1oods''' Released: July 2007

    4 "INS

    BOOK SECTION

    thenti!ation Te!hni5#es and Infrastr#!t#res from: in#6

    Se!#rity Coo2%oo2 %y +o%ert ,' Byrnes''' Released: June 2003

    7 "INS

    o Information Te!hnology8Operations

    https://www.safaribooksonline.com/library/view/the-modern-rpg/9781583470640/pr03.htmlhttps://www.safaribooksonline.com/library/view/the-modern-rpg/9781583470640/https://www.safaribooksonline.com/library/view/the-modern-rpg/9781583470640/https://www.safaribooksonline.com/t/databases/https://www.safaribooksonline.com/library/view/wikis-for-dummies/9780470043998/ch01.htmlhttps://www.safaribooksonline.com/library/view/wikis-for-dummies/9780470043998/https://www.safaribooksonline.com/library/view/linux-security-cookbook/0596003919/ch04.htmlhttps://www.safaribooksonline.com/library/view/linux-security-cookbook/0596003919/https://www.safaribooksonline.com/library/view/linux-security-cookbook/0596003919/https://www.safaribooksonline.com/t/information-technologyoperations/https://www.safaribooksonline.com/library/view/the-modern-rpg/9781583470640/pr03.htmlhttps://www.safaribooksonline.com/library/view/the-modern-rpg/9781583470640/https://www.safaribooksonline.com/library/view/the-modern-rpg/9781583470640/https://www.safaribooksonline.com/t/databases/https://www.safaribooksonline.com/library/view/wikis-for-dummies/9780470043998/ch01.htmlhttps://www.safaribooksonline.com/library/view/wikis-for-dummies/9780470043998/https://www.safaribooksonline.com/library/view/linux-security-cookbook/0596003919/ch04.htmlhttps://www.safaribooksonline.com/library/view/linux-security-cookbook/0596003919/https://www.safaribooksonline.com/library/view/linux-security-cookbook/0596003919/https://www.safaribooksonline.com/t/information-technologyoperations/
  • 8/9/2019 Physical File basics

    57/57

    BOOK SECTION

    Introd#!tion from: IB" i78iSeries Primer. *o#rth Edition %y

    +on 9aw2ins''' Released: May 2006

    7 "INS

    Enjoy Safari S#%s!ri%e Today

    Blog

    Support

    Feed2ack

    Sign n@ +%$ Sa3ari4 erm! o3 Ser ice , em2er!hip Agreement , Pri acy Policy

    https://www.safaribooksonline.com/library/view/ibm-i5iseries-primer/9781583470398/pr03.htmlhttps://www.safaribooksonline.com/library/view/ibm-i5iseries-primer/9781583470398/https://www.safaribooksonline.com/subscribe/http://blog.safaribooksonline.com/http://support.safaribooksonline.com/?prod=flowmailto:[email protected]://www.safaribooksonline.com/accounts/login/http://www.safaribooksonline.com/https://www.safaribooksonline.com/terms/https://www.safaribooksonline.com/membership-agreement/https://www.safaribooksonline.com/membership-agreement/https://www.safaribooksonline.com/privacy/https://www.safaribooksonline.com/privacy/https://www.safaribooksonline.com/library/view/ibm-i5iseries-primer/9781583470398/pr03.htmlhttps://www.safaribooksonline.com/library/view/ibm-i5iseries-primer/9781583470398/https://www.safaribooksonline.com/subscribe/http://blog.safaribooksonline.com/http://support.safaribooksonline.com/?prod=flowmailto:[email protected]://www.safaribooksonline.com/accounts/login/http://www.safaribooksonline.com/https://www.safaribooksonline.com/terms/https://www.safaribooksonline.com/membership-agreement/https://www.safaribooksonline.com/privacy/