• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1142
  • Last Modified:

Mainframe - How to create several datasets using a loop (conditional programming)

I'm a newbie at the mainframe and all the terms are confusing.  
Just the fact that in submitting a job you can have jcl, sas and cobol together and then you have a whole bunch of mainframe utilities..... "can anyone say confusing".

My Question:
Mainframe - How to create several datasets using a loop (conditional programming)
What do I need to use JCL, Cobol....

so when I run it I can assign a number say 10 for example:
ibmmahine1.it.customers.data1
ibmmahine1.it.customers.data2
ibmmahine1.it.customers.data3
ibmmahine1.it.customers.data4
ibmmahine1.it.customers.data5
ibmmahine1.it.customers.data6
ibmmahine1.it.customers.data7
ibmmahine1.it.customers.data8
ibmmahine1.it.customers.data9
ibmmahine1.it.customers.data10

Thanks.


0
sch626
Asked:
sch626
  • 2
1 Solution
 
sufianmehmoodCommented:
i do not know much about main frames but the algorithm can be very simple
int MAX_POSSIBLE_DATASET = 10;
DataSet[] myResults = new DataSet[MAX_POSSIBLE_DATASET];
loop condition here
for(int i=0; i < MAX_POSSIBLE_DATASET; i++)
{
myResults[i] = GetResultDataSet(i);
}

This might not exactly work for you but just to give you an idea, you can use an array/list for the job.
0
 
giltjrCommented:
JCL is very basic and has looping capabilities.

If you have SAS you can do this.  Do you have access to batch TSO and REXX?  

However, is there a special reason why you need to have these files pre-allocated?

0
 
sch626Author Commented:
I was asking for JCL code and I didn't get any..
0
 
giltjrCommented:
That is because you can't do it in JCL.  JCL is not a programming language.  You need a scripting/programming language, such as REXX, TSO Clist, Assembler, or SAS.

REXX, TSO Clist, or SAS would be the easiest and in that order.

If you still need to do this, you need to let us know what scripting/programming languages you have access to.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now