day-04lf

Upload: vijay-das

Post on 03-Jun-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 Day-04LF

    1/14

    WORK WITH LOGICAL-FILEDay 4

    Logical Files:

    Overview:

    This module enables the student to understand the concept of Logical File.

    Outline:Topics covered,

    Logical le creation

    Concept of Keyed !e"uential access

    Commands related to les

    Obective:#y the end of this module, the student should be able to$

    Create a Logical le

    %nderstand the part of Logical les. Commands related to les.

    & Du'e!tar Technologies (vt. Ltd. )*)4No part of this document can be copied, reproduced in any form, complete or partial without written consent from DukeStar Technologies Pvt.

    Ltd.

  • 8/12/2019 Day-04LF

    2/14

    WORK WITH LOGICAL-FILEDay 4

    Logical File:+ logical le is provide access the data stored in one or more physical les. The featuresuni"ue to logical les include the folloing$

    ). Logical les do not contain data.-. +ccess one or more physical les in an arrival se"uence or in any single or multiple

    eld 'ey/ value order.0. + physical le may be processed by any number of logical les.4. To or more logical les may share the same access path.1. 2mit and select criteria may be specied in a logical le to process only the

    re"uired physical le data.3. + logical le may include multiple record formats. ach format hoever must relate

    to one or more physical les and include at least one 'ey eld.5. 2ne logical le ith multiple record formats may process only the re"uired physical

    le data.6. + logical le ith multiple record formats may be used to process the data from

    more than one physical le. The le record formats accessed may be of di7erentlengths.

    8 During processing a physical le9s eld attributes may be changed by a logical le.

    :oever, the data stored in the physical le not be modied.

    Logical les may be specied as either nonoin or oin. + non;oin logical le processeseach record individually from one or more physical les.

  • 8/12/2019 Day-04LF

    3/14

    WORK WITH LOGICAL-FILEDay 4

    :o to create simple logical le Create student pf le as discussed above. Li'e physicalle create logical le as shon belo. (ress *F+,

    I# #E.T %TE/ 0O1 HA2E TO WRITE %O1RCE T0/E A% *LF, %O1RCE (E(3ER 4

    Start Source Entry Utility (STRSEU)

    Type choices, press Enter.

    Source file . . . . . . . . . . > MYDDS Name, !R"

    #i$rary . . . . . . . .> !%&'U&'D Name, #%#, UR#%, !R"

    Source mem$er . . . . . . . . . #STUDENT Name, !R", SE#ET

    Source type . . . . . . . . . . #* Name, S+ME, %+S, %+S!...

    Tet -escription/ . . . . . . . -#01+# *#E *0R STUDENT/

    %ottom

    *23Eit *43!rompt *53Refresh *'63ancel *'237o8 to use this isplay

    *643More 9eys

    PRESS ENTER SO THAT YOU GET THE FOLLOWING SCREEN

    olumns . . . : ' ;' Eit S7EET #STUDENT

    *MT #* .....+..........T.Name.#enTDp%......*unctions

    %e?innin? of ata @@@@@@@

    @@@@@@@

    @@@@@@@

    @@@@@@@

    @@@@@@@

    @@@@@@@

    @@@@@@@

    @@@@@@@

    @@@@@@@

    @@@@@@@

    @@@@@@@

    @@@@@@@

    @@@@@@@

    @@@@@@@

    @@@@@@@ En of ata

    *23Eit *43!rompt *53Refresh *A3RetrieBe *'&3ursor *''3To??le

    *'C3Repeat fin *';3Repeat chan?e *643More 9eys

    Mem$er #STUDENT ae tofile !N&'U&'D

  • 8/12/2019 Day-04LF

    4/14

    WORK WITH LOGICAL-FILEDay 4

    olumns . . . : ' ;' Eit !%&'U&'D #STUDENT

    *MT #* .....+..........T.Name.#enTDp%......*unctions

    %e?innin? of ata

    @@@@@@@

    En of ata

    !rompt type . . . #* Seuence num$er . . . FFFFF

    Name Data Decimal

    Type Name #en?th Type !ositions Use

    *unctions

    *23Eit *43!rompt *53Refresh *''3!reBious recor *'63ancel *623Select prompt

    *643More 9eys

    Enter re5erence 6le using */FILE&FILE #A(E), 5unction 7e! as well as recor85or9at na9e as sown below :

    olumns . . . : ' ;' Eit !%&'U&'D #STUDENT

    *MT #* .....+..........T.Name.#enTDp%......*unctions

    %e?innin? of ata

    &&&'.&& + R SR !*#E(STUDENT)

    En of ata

    !rompt type . . . #* Seuence num$er . . . &&&'.&&

    Name Data Decimal

    Type Name #en?th Type !ositions Use

    R SR

    *unctions

    !*#E(STUDENT)

    *23Eit *43!rompt *53Refresh *''3!reBious recor

    *'63ancel *623Select prompt *643More 9eys

    Enter 7e! 6el8 o5 re5erre8 "!sical 6le :

    & Du'e!tar Technologies (vt. Ltd. 4*)4No part of this document can be copied, reproduced in any form, complete or partial without written consent from DukeStar Technologies Pvt.

    Ltd.

    File name usin (F=L/

  • 8/12/2019 Day-04LF

    5/14

    WORK WITH LOGICAL-FILEDay 4

    olumns . . . : ' ;' Eit !%&'U&'D #STUDENT

    *MT #* .....+..........T.Name.#enTDp%......*unctions

    %e?innin? of ata

    &&&'.&& + R SR !*#E(STUDENT)

    &&&6.&& G R0##

    En of ata

    !rompt type . . . #* Seuence num$er . . . &&&6.&&

    Name Type Name #en?th Type Decimal !ositions Use

    G R0##

    *unctions

    *23Eit *43!rompt *53Refresh *''3!reBious recor

    *'63ancel *623Select prompt *643More 9eys

    /ress F; an8 use o"tion

  • 8/12/2019 Day-04LF

    6/14

    WORK WITH LOGICAL-FILEDay 4

    olumns . . . : ' ;' Eit !%&'U&'D #STUDENT

    *MT #* .....+..........T.Name.#enTDp%......*unctions

    %e?innin? of ata

    &&&'.&& + R RSTUDENT !*#E(STUDENT)

    &&&6.&& + R0##

    &&&2.&& + SN+ME

    &&&4.&& + 0RS

    &&&5.&& + G R0##

    En of ata

    *23Eit *43!rompt *53Refresh *A3RetrieBe *'&3ursor *''3To??le

    *'C3Repeat fin *';3Repeat chan?e *643More 9eys

    H 0!YR17T %M 0R!. 'AI', 6&&6.

    Above logical 6le sows 5ollowing out"ut:

    1se R1#@R0 co99an8 on co99an8 "ro9"t to see te out"ut

    Display Report

    Report 8ith . . . . . : 'A

    !osition to line . . . . . Shift to column . . . . . .

    #ine ........'........

    R0## SN+ME 0RS

    &&&&&' '&' sneha BB

    &&&&&6 '&6 ramesh hh

    &&&&&2 '&2 titu iii

    &&&&&4 '&4 rahul +S4&&

    En of report

    %ottom

    *23Eit *'63ancel *'A3#eft *6&3Ri?ht *6'3Split

    Also !ou are able to 8e6ne 9ulti5or9at logical 6le as sown below:

    olumns . . . : ' ;' Eit !%&'U&'S #STUDENT

    & Du'e!tar Technologies (vt. Ltd. 3*)4No part of this document can be copied, reproduced in any form, complete or partial without written consent from DukeStar Technologies Pvt.

    Ltd.

  • 8/12/2019 Day-04LF

    7/14

    WORK WITH LOGICAL-FILEDay 4

    *MT #* .....+..........T.Name.#enTDp%......*unctions

    %e?innin? of ata

    &&&'.&& + R RS !*#E(STUDENT)

    &&&6.&& + R0##

    &&&2.&& + SN+ME

    &&&4.&& + 0RS

    &&&5.&& + G R0##

    &&&5.&'

    &&&C.&& + R R0RS !*#E(0RS)

    &&&;.&& + G D

    En of ata

    *23Eit *43!rompt *53Refresh *A3RetrieBe *'&3ursor *''3To??le

    *'C3Repeat fin *';3Repeat chan?e *643More 9eys

    HOW TO 1%E COLH'G *TE.T, KBW:

    Colu9ns : < < E8it /3>

  • 8/12/2019 Day-04LF

    8/14

    WORK WITH LOGICAL-FILEDay 4

    #ine ........'........6.

    R0## N0 SN+ME 0RS

    &&&&&' '&' sneha BB

    &&&&&6 '&6 ramesh hh

    &&&&&2 '&2 titu iii

    &&&&&4 '&4 rahul +S4&&

    En of report

    %ottom

    *23Eit *'63ancel *'A3#eft *6&3Ri?ht *6'3Split

    The following keywords are select and omit level keywords:1.COMP 2.RANGE 3. VALUE

    HOU TO USE ABOVE KEYWORD WITH SELECT & OMIT:olumns . . . : ' ;' Eit !%&'U&'D #STUDENT

    *MT #* .....+..........T.Name.#enTDp%......*unctions

    %e?innin? of ata

    &&&'.&& + R RS !*#E(STUDENT)

    &&&6.&& + R0## 0#7D1(-R0## N0/)

    &&&2.&& + N+ME TEJT(-STUDENT DET+#/)

    &&&4.&& + 0RS

    &&&4.&' + G R0##

    &&&5.&& + S R0## 0M!(1T '&6)

    En of ata

    !rompt type . . . #* Seuence num$er . . . &&&4.&'

    Name Data Decimal

    Type Name #en?th Type !ositions Use

    S R0##

    *unctions

    0M!(1T '&6)

    *23Eit *43!rompt *53Refresh *''3!reBious recor

    *'63ancel *623Select prompt *643More 9eys

    +bove eld shos the folloing output$

    & Du'e!tar Technologies (vt. Ltd. 6*)4No part of this document can be copied, reproduced in any form, complete or partial without written consent from DukeStar Technologies Pvt.

    Ltd.

    F2?!LCTK*B

    F2? T: !LCTD

  • 8/12/2019 Day-04LF

    9/14

    WORK WITH LOGICAL-FILEDay 4

    Display Report

    Report 8ith . . . . . : 6'

    !osition to line . . . . . Shift to column . . . . . .

    #ine ........'........6.

    R0## N0 SN+ME 0RS

    &&&&&' '&2 titu iii&&&&&6 '&4 rahul +S4&&

    En of report

    %ottom

    *23Eit *'63ancel *'A3#eft *6&3Ri?ht *6'3Split

    Like that we are able to use range and value keyword with logical file. Now use of omits keyword

    with logical file.

    olumns . . . : ' ;' Eit !%&'U&'D #STUDENT

    *MT #*.....+..........T.Name.#enTDp%......*unctions

    %e?innin? of ata

    &&&'.&& + R RS !*#E(STUDENT)

    &&&6.&& + R0## 0#7D1(-R0## N0/)&&&2.&& + N+ME TEJT(-STUDENT DET+#/)

    &&&4.&& + 0RS

    &&&4.&' + G R0##

    &&&5.&& + 0 R0## 0M!(1T '&6)

    En of ata

    *23Eit *43!rompt *53Refresh *A3RetrieBe *'&3ursor *''3To??le*'C3Repeat fin *';3Repeat chan?e *643More 9eys

    H 0!YR17T %M 0R!. 'AI', 6&&6.

    Note:Omit keyword is always used with DYNSLT to omit the value. This is logical fle levelkeyword.

    Out"ut o5 above *o9it, 7e!wor8 is as sown below see it using R1#@R0co99an8 on co99an8 line:

    & Du'e!tar Technologies (vt. Ltd. 8*)4No part of this document can be copied, reproduced in any form, complete or partial without written consent from DukeStar Technologies Pvt.

    Ltd.

  • 8/12/2019 Day-04LF

    10/14

    WORK WITH LOGICAL-FILEDay 4

    Display Report

    Report 8ith . . . . . : 6'

    !osition to line . . . . . Shift to column . . . . . .

    #ine ........'........6.

    R0## N0 SN+ME 0RS

    &&&&&' '&& +% +S4&&

    &&&&&6 '&' sneha BB

    En of report

    %ottom

    *23Eit *'63ancel *'A3#eft *6&3Ri?ht *6'3Split

    0ou can use tis 7Bw on one 6el8 one 6le as sown below

    olumns . . . : ' ;' Eit !%&'U&'D #STUDENT

    *MT #* .....+..........T.Name.#enTDp%......*unctions

    %e?innin? of ata

    &&&'.&& + R RS !*#E(STUDENT)

    &&&6.&& + R0## 0#7D1(-R0## N0/)

    &&&2.&& + SN+ME TEJT(-STUDENT DET+#/)&&&4.&& + 0RS

    &&&5.&& + G R0##

    &&&C.&& + 0 R0## 0M!(E= '&6)

    &&&;.&& + S R0## 0M!(1T '&&)

    En of ata

    *23Eit *43!rompt *53Refresh *A3RetrieBe *'&3ursor *''3To??le

    *'C3Repeat fin *';3Repeat chan?e *643More 9eys

    H 0!YR17T %M 0R!. 'AI', 6&&6.

    0UT!UT 0* T7S 0M!+RS0N S

    & Du'e!tar Technologies (vt. Ltd.)E*)4No part of this document can be copied, reproduced in any form, complete or partial without written consent from DukeStar Technologies Pvt.

    Ltd.

  • 8/12/2019 Day-04LF

    11/14

    WORK WITH LOGICAL-FILEDay 4

    Display Report

    Report 8ith . . . . . : 6'

    !osition to line . . . . . Shift to column . . . . . .

    #ine ........'........6.

    R0## N0 SN+ME 0RS

    &&&&&' '&' SNE7+ ""

    &&&&&6 '&2 titu iii

    En of report

    %ottom *23Eit *'63ancel *'A3#eft *6&3Ri?ht *6'3Split

    1se o5 value 7e!wor8 :

    columns . . . : ' ;' Eit !%&'U&'D #STUDENT *MT

    #* .....+..........T.Name.#enTDp%......*unctions

    %e?innin? of ata

    &&&'.&& + R RS !*#E(STUDENT)

    &&&6.&& + R0## 0#7D1(-R0## N0/)&&&2.&& + N+ME TEJT(-STUDENT DET+#/)

    &&&4.&& + 0RS

    &&&4.&' + G R0##

    &&&C.&& + 0 R0## "+#UES('&6)

    &&&;.&& + S R0## 0M!(1T '&&)

    En of ata

    *23Eit *43!rompt *53Refresh *A3RetrieBe *'&3ursor *''3To??le

    *'C3Repeat fin *';3Repeat chan?e *643More 9eys

    2utput of this 'eyord is here roll number having value )E- gets omitted.

    & Du'e!tar Technologies (vt. Ltd.))*)4No part of this document can be copied, reproduced in any form, complete or partial without written consent from DukeStar Technologies Pvt.

    Ltd.

  • 8/12/2019 Day-04LF

    12/14

    WORK WITH LOGICAL-FILEDay 4

    Display Report

    Report 8ith . . . . . : 6'!osition to line . . . . . Shift to column . . . . . .

    #ine ........'........6.

    R0## N0 SN+ME 0RS

    &&&&&' '&' sneha BB

    &&&&&6 '&2 titu iii

    En of report

    %ottom

    *23Eit *'63ancel *'A3#eft *6&3Ri?ht *6'3Split

    & Du'e!tar Technologies (vt. Ltd.)-*)4No part of this document can be copied, reproduced in any form, complete or partial without written consent from DukeStar Technologies Pvt.

    Ltd.

  • 8/12/2019 Day-04LF

    13/14

    WORK WITH LOGICAL-FILEDay 4

    @uestions relate8 to above session:

    ;

  • 8/12/2019 Day-04LF

    14/14

    WORK WITH LOGICAL-FILEDay 4

    #o Fiel8 #a9e Length Data Type Description) E(/#O 1,E ( mployee number- E(/#( -E + mployee @ame0 E(/A'' -E + mployee +ddress4 E(/%AL 5,- ( mployee !alary1 E(/'/T )E + mployee Dept.

    ). +dd the primary 'ey constraint %sing +DD(FC!T/ named C!T) on (F %*L.-. +dd records using DF% and observe the e7ect on addition of duplicate records.0. ?emove the constraint C!T) using the command ?JG(FC!T.4. +dd the %ni"ue 'ey constraint %sing +DD(FC!T/ named C!T- on (F %*L.1. +dd records using DF% and observe the e7ect on addition of duplicate records.3. ?emove the constraint C!T- using the command ?JG(FC!T.

    ;;D : Create a physical le EMPLDith the folloing DD!

    #o Fiel8 #a9e Lengt 'ata T!"e 'escri"tion) E(/#O 1,E ( mployee @o- E(/'/T )E + mployee @ame

    ). +dd referential constraint C!T0 on the (F J(LD giving parent le name as %*L.Try to delete a dependent record from %*LD. ?emove the constraint CST"usingthe command ?JG(FC!T.

    -. +dd a physical le trigger on %*LD ith trigger time as #F2?, event as=@!?T and (rogram @ame as Test. 2b;ect of this program ill be copied into yourlibrary/.

    0. @ame the to types of logical les. :o do they di7er in processing logic

    4. Bhen a logical le references one or more physical les, hat is automatically builtby each logical le to control processing

    1. Bhat is the function of a (F=L 'eyord

    3. :o many physical les ill be accessed by the non;oin logical e

    5. Bhat is he function of the F2?J+T 'eyord

    6. Bhat is function of the D!C@D 'eyord

    & Du'e!tar Technologies (vt. Ltd.)4*)4No part of this document can be copied, reproduced in any form, complete or partial without written consent from DukeStar Technologies Pvt.

    Ltd.