Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

create files dynamically
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
mlp

New User


Joined: 23 Sep 2005
Posts: 91

PostPosted: Thu Nov 25, 2010 11:00 am    Post subject: create files dynamically
Reply with quote

I have a requirement wherein I have to create GDG bases and flat files dynamically. That means the names of the GDG bases and flat files will be changed dynamically by a COBOL program and acordingly the GDG bases and flat files would be created.

Now via COBOL program I can create control cards for defineing GDG bases which will be used by a successor step in my JCL which will execute the IDCAMS utility. So defining GDG bases is done. But once it comes to creating a flat file then I dont think IDCAMS would help me or neither any other IBM utility. The reason being the file name is dynamically decided.

Can anybody suggets me a way via which I can realise this reqiuirement?
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Thu Nov 25, 2010 11:19 am    Post subject:
Reply with quote

hmmmm.. what's wrong with TSO ALLOCATE command? icon_rolleyes.gif

O.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Nov 25, 2010 11:20 am    Post subject:
Reply with quote

Hello,

Do the same sort thing for the files as the GDG bases. . .

Generate the needed jcl and submit this via the internal reader to be run as a new job rather than a successor step.
Back to top
View user's profile Send private message
mlp

New User


Joined: 23 Sep 2005
Posts: 91

PostPosted: Thu Nov 25, 2010 12:14 pm    Post subject:
Reply with quote

Need to check whether the use of INTRDR is allowed with my current client or not.

But via REXX also, can we allocate datasets with their space parameters, dataclas and disposition etc?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Thu Nov 25, 2010 12:16 pm    Post subject:
Reply with quote

Yes, it could be done from REXX, as well as from within COBOL (using TSO services).

O.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Nov 25, 2010 12:20 pm    Post subject: Re: create files dynamically
Reply with quote

mlp wrote:
But once it comes to creating a flat file then I dont think IDCAMS would help me or neither any other IBM utility. The reason being the file name is dynamically decided.
Then obviously you have not taken the time to read the IDCAMS manual.

If you can generate control statements to allocate a GDG base, you can also generate the statements to allocate datasets.

I assume this is what you want to do as your original post is not specific.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Thu Nov 25, 2010 12:24 pm    Post subject:
Reply with quote

But why adding steps if can get it all from within single REXX/COBOL?

O.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Nov 25, 2010 12:26 pm    Post subject:
Reply with quote

Ofer, I prefer that way, as it leaves an easily followed audit trail of what the job has done. I have had cases where datasets were dynamically allocated within programs and hated following up the next JCL error for duplicate dsn.

If it's easy to follow it's easy to fix icon_lol.gif
Back to top
View user's profile Send private message
mlp

New User


Joined: 23 Sep 2005
Posts: 91

PostPosted: Thu Nov 25, 2010 2:52 pm    Post subject:
Reply with quote

Thanks for your help.

With IDCAMS ALLOCATE it is possible to allocate the flat file (PS).
Back to top
View user's profile Send private message
mlp

New User


Joined: 23 Sep 2005
Posts: 91

PostPosted: Thu Dec 16, 2010 2:31 pm    Post subject:
Reply with quote

Now there is a different problem.

I am doing more than 3000 dataset operations in one go via IDCAMS. It gives me below error.

IKJ56220I MAXIMUM NUMBER OF DATA SET ALLOCATIONS ALLOWED BY YOUR
IKJ56220I SESSION HAS BEEN REACHED, YOU SHOULD FREE UNUSED DATA SETS
IDC3003I FUNCTION TERMINATED. CONDITION CODE IS 12

I specified DYNAMNBR=3273 (maximum) at the IDCAMS step, but it gives me MAXCC 12 after 10 dataset operations.

When I specify DYNAMNBR=500 then it processes more dataset operations. I am not getting why the DYNAMNBR=500 processing more operations than that of the maximum DYNAMNBR (3273).

I need to decide the maximum number of dataset operations those can be executed by IDCAMS without MAXCC 12 (with success). So what can be the value of DYNAMNBR parameter that can be used over here?

Also, if there is any other option then please let me know.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Dec 16, 2010 3:46 pm    Post subject:
Reply with quote

Are you running IDCAMS in a TSO session?
Back to top
View user's profile Send private message
mlp

New User


Joined: 23 Sep 2005
Posts: 91

PostPosted: Thu Dec 16, 2010 5:11 pm    Post subject:
Reply with quote

No. I am executing IDCAMS via a JCL.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Dec 16, 2010 5:12 pm    Post subject:
Reply with quote

So why the IKJ messages?

A TSO batch job?
Back to top
View user's profile Send private message
mlp

New User


Joined: 23 Sep 2005
Posts: 91

PostPosted: Thu Dec 16, 2010 5:18 pm    Post subject:
Reply with quote

Yes a TSO batch job and it gave me these messages in the SYSPRINT.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Dec 16, 2010 5:31 pm    Post subject:
Reply with quote

My idea is feeding 3000 datasets to idcams to be allocated dynamically
is a bit to much for the batch session. Idcams doesnt do a free for those datasets. Maybe you could do loop to run idcams multiple times for a certain amount of datasets.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Dec 16, 2010 9:49 pm    Post subject:
Reply with quote

Hello,

Why does someone believe it is proper to allocate 3000+ datasets at one time. . . icon_confused.gif
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Thu Dec 16, 2010 9:53 pm    Post subject:
Reply with quote

Instead of invoking IDCAMS from a batch TSO environment, run IDCAMS directly as a utility program. Your error is due to limitations set in your installation's TSO adress space definitions.
Back to top
View user's profile Send private message
mlp

New User


Joined: 23 Sep 2005
Posts: 91

PostPosted: Fri Dec 17, 2010 8:42 am    Post subject:
Reply with quote

Are you trying to say that I should invoke IDCAMS from COBOL prog?

If that so, can anybody provide me the interface of IDCAMS? So that I can incorporate the same in my COBOL module.
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Fri Dec 17, 2010 2:47 pm    Post subject:
Reply with quote

mlp wrote:
Are you trying to say that I should invoke IDCAMS from COBOL prog?

If that so, can anybody provide me the interface of IDCAMS? So that I can incorporate the same in my COBOL module.

That was not what I meant.

You stated in an earlier post that you were running IDCAMS in a batch environment, but from the error messages we could tell that you were running TSO (EXEC PGM=IKJEFTxx).

I merely suggested that your JCL should execute IDCAMS directly, with EXEC PGM=IDCAMS.

I am mistaken, please provide more details on the IDCAMS execution, like your JCL.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Fri Dec 17, 2010 3:18 pm    Post subject:
Reply with quote

Running IDCAMS in a batch TSO session suggests to me that the TS
creates the input for IDCAMS (by Rexx/CLIST). So thats why i stated
in a previous comment, to divide the IDCAMS input in parts and execute
IDCAMS in a loop for all those parts. So after termination of every IDCAMS call the necessary de-allocations will be done.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us