Submitted Questions

  • Create a GDG base

    How to create a GDG base, GDG version and read that version and create the next GDG version in the same job?

  • Define KSDS

    How will you define a KSDS of avg length-100 and max length-150 and key length 10

    Star Read Best Answer

    Editorial / Best Answer

    Yaswanth kodali  

    • Member Since Jul-2010 | Jul 12th, 2010


    We can define the KSDS cluster by two ways by using the file-aid or by using the IDCAMS Utlity..

    By using the IDCAMS utility we can define the record with average length 100 and maximum length 150 with keylength 10 starting at 0 as follows

    //step01 EXEC pgm=IDCAMS
    //SYSIN DD *

       DEFINE CLUSTER(NAME(userid.name.sample) -
                                   VOLUMES(MVS801)              -
                                   RECORDSIZE(100 150)        -
                                   TRACKS(10 20)
                                   KEYS(10 0)                          -
                                   INDEXED  )                          -
                        DATA ( NAME(userid.name.sample.data))  -
                        INDEX( NAME(userid.name.sample.index)) -     
    /*
    // 

  • JCL program Copy Book Copylib

    You have mentioned the copylib in JCL program but the copy book is not expanded in the program what is the possible error you get?

    Nandhakumar Babu

    • Aug 20th, 2015

    Unless there is no variable from the copybook is used in the program there is no issue, but it would result in return of severe code (12) when a variable in the copybook has been used in your application program.

    Gyani01

    • Mar 9th, 2011

    Actually if you mention the copybook library in JCL it doesnt expand it in output. While compiling the program, there will be a option asking "Do you need to expand copy book".Hope this is what you are asking.

  • Sort Data in File

    In COBOL, How to sort data in a file without using the sort command?

    mannurusrinivasulareddy

    • Oct 5th, 2011

    ws-rec is an occurs clause variable name. "cobol perform sort-para varying I from 1 by 1 until I > (no of records) after J from I by 1 until J > (no of r...

  • Change Dataset Name in PROC

    How will you change the dataset name in PROC without altering it?

    kckinney

    • Sep 3rd, 2010

    You can override it from the calling job.  One way is to use a JCL override in the form of - PROCSTEP.PROCDD DD DSN=[overriding dsn name]This is fine provided you always use the same override dat...

    avr1985

    • Jul 4th, 2010

    You can change the dataset name in the procedure without change its name in the Proc.,  mention STEPNAME.DDNAME DSN=NEWFILE NAME by writing above code in JCL  it changes the proc DS in proc.

  • Pass Parameter from JCL to COBOL

    How will you pass a parameter from JCL to COBOL without using param and sysin?

    Mehul

    • Feb 26th, 2016

    You can have the parameters as the contents of a file and then read that file in the Cobol program for the parameters.

    Ishaan Tewari

    • Feb 19th, 2016

    Return code can be set through program and is very useful in handling the step execution based on RC using IF ELSE construct.