Search code examples
membermainframejcl

How to get text in my new member using JCL


I have to make a new member in a JCL. This isn't a problem: My code:

//STEP1 EXEC PGM=IEBGENER
//SYSUT1 DD *
//SYSUT2 DD DISP=(NEW,KEEP),UNIT=SYSALLDA,DSN=name.JCL4(MEMBER),
            SPACE=(CYL,(1,1,45)),
            VOL=SER=DMTU01
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
/*

But I want that my MEMBER1 contains text. So when I go in JCL4 and I press an e (edit) before MEMBER, I want to see some text like 'Hallo'. Can someone help me to explain how to do this?


Solution

  • If you are creating a new member in an existing JCL dataset, Try:

    //STEP1   EXEC PGM=IEBGENER
    //SYSUT1  DD  *
       Hello
    /*
    //SYSUT2  DD DSN=name.JCL4(MEMBER),DISP=(SHR,KEEP)
    //SYSIN DD DUMMY
    /*
    

    The Disp refers to the dataset and not the member. so if the dataset already exists, you do not need to create it !!.


    If you want create a new JCL dataset and a member at the same time, the JCL should be like (where you catlg the dataset)

    //STEP1   EXEC PGM=IEBGENER
    //SYSUT1  DD  *
       Hello
    /*
    //SYSUT2  DD DSN=name.JCL4(MEMBER),DISP=(NEW,CATLG),
    //           UNIT=SYSALLDA,     should this be sysda ???
    //           SPACE=(CYL,(1,1,45)),
    //           VOL=SER=DMTU01
    //SYSIN DD DUMMY
    /*