datasetmainframejcl

Hi there, I am very new to mainframe and JCL, and I need some help understanding what this means/what I have to do


I am so sorry if this is dumb of me to ask, but I have reached out to others on my team and most of them are on vacation this time of year. I received a list of things to work on (I am an apprentice) and some I know how to do but some I do not. I am very new to the mainframe. The parts I am having trouble with are numbers 5 and 6. I know how to create a PS file, but I do not know about the file structure aspect and what they mean by at least 60 records in number 6. Like I said, I am sorry if this is a stupid question but I really appreciate any help. Thank you so much.

  1.        Create a PS file using ISPF 3.2 option
    
  2.        Create a PS file using JCL
    
  3.        Create a PDS file using ISPF 3.2 option
    
  4.        Create a PDS file using JCL
    

**5. Create a PS file to record your monthly expenses - the file structure will be;

Char 1 – 3 Month e.g. JAN FEB …

Char 5 – 6 Day e.g. 01 02 03 …11..30 31

Char 8 – 30 Description of the expense (e.g. TRAVEL, FOOD, CINEMA, ETC)

Char 32 – 41 10 digits right aligned amount with 2 decimal digit e.g. 99.01 1100.33

  1.        Add some data for step#5 -  at least 60 records**
    
  2.        Write a IEBGENER JCL to backup #5 dataset
    
  3.        Write a SORT JCL to sort data on amount in descending order – max amount at top …
    
  4.        Write a SORT JCL to extract expenses of FEB
    
  5.      Write a SORT JCL to sort data on MONTH
    
  6.      Write a JCL to extract month-wise data and each month-wise data should be save as a month member in the #3 dataset i.e. PDSNAME(JAN), PDSNAME(FEB), PDSNAME(MAR)….
    
  7.      Write an IDCAMS JCL to delete backup taken in #7
    
  8.      Redo #7 and Write an IEFBR14 JCL to delete that backup
    
  9.      Write a SORT JCL to calculate  monthly  total TRAVEL expenses
    
  10.      Write a multi-step JCL that:
    

a. Creates a dataset LIKE #5 using IEFBR14

b. Copies #5 dataset into 15.a dataset using IDCAMS

  1. IBM utilities such as IEFBR14, SORT, IEBGENER, IDCAMS

I tried looking up some tutorials but couldn't find what I was looking for so I thought I would take a chance and ask here.


Solution

  • #5 is just describing the format of each record (line) in your data set, with fields in columns like this:

    MMM DD description goes here   dollars.cc
    --- -- ----------------------- -------.--
    123456789 123456789 123456789 123456789 1
            10        20        30        40
    

    So when you create this data set, the record length has to be at least 41.(*) There's nothing special you do to define this format in creating your data set; it's just the format you'll use when you add data to it.

    (*) That's 41 if it's in fixed record format, RECFM(F). If it's variable record format, RECFM(V), then it uses 4 extra bytes to store the length of each record, so the record length has to be at least 45. But since you know every record will be exactly 41 bytes, it would make sense to use fixed format.

    #6 is just saying to put some sample data in that data set so you have it to use in all the other tasks. Edit it and add 60 or more lines in the format above, like:

    ***************************** Top of Data ******************************
    JAN 23 TRAVEL                     1420.32
    FEB 15 FOOD                         24.59
    MAR 10 ENTERTAINMENT               125.67
    **************************** Bottom of Data ****************************
    

    etc. Just make up a bunch of dates and numbers to be used as input for the rest of the tasks.