Endevor

 View Only
  • 1.  FM IMS Questions Answered

    Posted Jun 25, 2018 10:00 AM

    This was copied over from a FM "IDEA" thread that was off topic, related to EXTRACTing and RELOADING data:

     

    Hi Rohit,

     

    This is Ralf from CA File Master support and I would like to try to answer your question.

     

    First of all - there are three CA File Master Plus products, one for MVS, one for IMS and one for DB2. The following is for CA File Master for IMS.

    Regarding your ISPF question - see https://docops.ca.com/ca-file-master-plus/11/en/configuring/configure-your-product-without-ca-csm/ca-file-master-plus-for-ims-tasks please.

    CAWKFM is the REXX procedure to call CA File Master for IMS. See topic "Customize REXX EXEC".

    Topic "Add Option Name to an ISPF Menu Panel (Optional)" describes the steps how to add CA File Master for IMS to an existing ISPF panel. It's common to add it to the "ISPF/PDF PRIMARY OPTION MENU". Then you could call File Master for IMS by typing "FM" from the "ISPF/PDF PRIMARY OPTION MENU".

    https://docops.ca.com/ca-file-master-plus/11/en/using-ispf/ispf-user-interface-for-ca-file-master-plus-for-imsdescribes how to use CA File Master for IMS in ISPF.

     

    This page: https://docops.ca.com/ca-file-master-plus/11/en/using-ispf/ispf-user-interface-for-ca-file-master-plus-for-ims/working-with-the-dsn-list-directory describes how to use a DSN List.

     

    And this page describes how to EXTRACT and RELOAD data: https://docops.ca.com/ca-file-master-plus/11/en/using-ispf/ispf-user-interface-for-ca-file-master-plus-for-ims/using-utility-functions .

    Here is an example:

     

    ------------- CA File Master Plus for IMS -- Extract IMS Database -------------

    COMMAND ===>                                                                

                                                                                  

    IMS Database to Extract:                                                      

       IMS Environment    ===> CAWKIVP                                            

       PSB or ACB Name    ===> ________  (if static PSB being used)               

       DBD Name           ===> CAWKIVD   (optional if PSB Name specified)         

                                                                                  

    Output Extract File:                                                          

       Dataset name       ===> 'your.FM110.EXTRACT.CAWKIVD'                      

       Disposition        ===> SHR       (NEW or SHR or OLD)                      

                                                                                  

    Extract all Seg Names ===> Y         Y/N (N for Segment Name Selection Screen)

    Execution mode       ===> O         S = Submit JCL   E = Edit JCL            

                                         O = Online                               

    Record Layout for Selection:                                                  

      Layout dataset ===> 'your.FM110.LAYOUT'                                    

      CRL dataset    ===>                                                         

                                                                                  

    Selection Criteria below or  Selection Criteria Member ===>                  

    ===>                                                                          

    ===>                                                                          

    ===>                                                                          

                                                                                  

     

    It is using online execution mode. But you could also create batch JCL as you can see.

    And yes, you can filter the data here - press PF1 with the cursor in the "Selection Criteria" area. It describes how to filter records:

     

    FIELD HELP -------------------- Selection Criteria -------------------- Page #1

                                                                                  

    IMS database records may be filtered according to a selection criteria. Below

    are some examples of valid selection criteria for the root segment data. See  

    the IFSEG and IFREC commands on the next page for additional selection options.

                                                                                  

    'TEXAS'                 'texas' (anycase) anywhere in the segment            

    C'TEXAS'                 Character string 'TEXAS' anywhere in the segment     

    80 EQ C'NY'             Position 80  for a length of 2 equals 'NY'           

    STATE-CODE NE 'NY'       Field STATE-CODE not equal 'NY'(requires LAYOUT info)

    STATE-CODE = C'NY,TX'   STATE-CODE is equal to 'NY' or 'TX'                  

    80 = C'NY,TX' AND       Position 80 for a length of 2 equals 'NY' or 'TX', AND

    100 = C"100,000"         position 100 for a length of 7 equals '100,000'      

    TRAN-DD GT '01' AND TRAN-DD LT '06' Field TRAN-DD is '02' '03' '04', or '05' 

    10(4) EQP               Pos 10 for a len of 4 is a packed value              

    100(2) = P'0,1,999'     2-byte packed field equals P'0' or P'1' or P'999'    

    101(20) CO 'NEW YORK'   'new york' (anycase) anywhere in position 101-120    

    STARTKEY='56789'         Start segment selection with the root segment whose  

                              key is GTEQ to '56789'                              

    INLIM=5000               Stop reading after reading 5000 IMS database records 

    SELLIM=1000             Only select 1000 IMS database records based on       

                            the selection criteria                              

                                                                                  

               ENTER or RIGHT to continue    LEFT to back up    END to exit       

     

    The PF1 field help key can be very helpful.

    Furthermore, you can enter "layout" in the command line. Then you can select segments:

    ...

    Select Segment to Build Condition                 -------- Row 1 of 7

    COMMAND ===>                                       SCROLL ===> CSR

                                                                        

      Segment Name    Cond                                              

    _ STUDENT                                                            

    _ SUBJECT                                                          

    s   TEACHER                                                         

    _   CLASS                                                          

    _ HISTORY                                                          

    _   TRANSCPT                                                        

    _   ATTEND                                                          

    ************************* End of Segments ***************************

     

    and you can filter the extract as follows - for instance, extracting records if the TEACHER-NAME field contains 'SAM SANDERSON':

     

    --------- CA File Master Plus for IMS -- Selection Criteria Row 1 to 11 of 11

     COMMAND ===>                                                 SCROLL ===> CSR

     Segment Name: TEACHER  Record Length: 117   Record Layout: CAWKXTCH          

           FIELD                      FMT  LEN  OP Compare Value or Field Name    

    01 TEACHER-SEGMENT                 A    117                                   

      05 TEACHER-NAME                A     30 CO 'SAM SANDERSON'                

      05 TEACHER-DEGREE                A      5                                   

      05 TEACHER-ID                    A      3                                   

      05 TEACHER-ADDR                  A     47                                   

        10 TEACHER-STREET              A     25                                   

        10 TEACHER-CITY                A     15                                   

        10 TEACHER-STATE               A      2                                  

        10 TEACHER-ZIP-CODE            A      5                                   

      05 TEACHER-HOME-PHONE            A     12                                   

      05 TEACHER-SCHOOL-PHONE          A     20                                  

    ********************************* End of Record *******************************

     

    Does it answer your question?

    Please let us know any question or problem.

     

    Thanks and regards,

    Ralf

     

    From <https://communities.ca.com/ideas/235726801-filemaster-dsn-to-copybook-layout-utility-using-existing-dsn-list-panels>