Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
get message and write a file depending on data in message

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries
View previous topic :: :: View next topic  
Author Message
grabeva

New User


Joined: 07 Sep 2006
Posts: 23

PostPosted: Mon Oct 19, 2009 9:46 pm    Post subject: get message and write a file depending on data in message
Reply with quote

Hello,

I need help!!!!
I have a cobol-program who get message from a queue.
At that queue have several messages, in that have an code who determine
the file i want to generate.

my job is that:

//XT0010 EXEC PGM=XTPMQ001,REGION=4096K
//STEPLIB DD DSN=ENDEVOR.ADMINWRK.LOADLIB,DISP=SHR
// DD DSN=MQM.V6R0.SCSQANLE,DISP=SHR
// DD DSN=MQMD.MQD1.SCSQAUTH,DISP=SHR
// DD DSN=MQM.V6R0.SCSQAUTH,DISP=SHR
//ASIENTOS DD DSN=TSBA.XT.DI.CONTABLE.ASIENTOS(+1),
// DISP=(,CATLG,DELETE),
// SPACE=(TRK,(3000,100),RLSE),
// RECFM=FB,LRECL=470
//BASE DD DSN=TSBA.XT.DI.CONTABLE.BASE(+1),
// DISP=(,CATLG,DELETE),
// SPACE=(TRK,(3000,100),RLSE),
// RECFM=FB,LRECL=470

the message have in pos 1: 1000 its correspond to create ASIENTOS, but
must not create BASE.
if i run job, create 1 generation from ASIENTOS y from BASE....

Can someone help me?????
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: Mon Oct 19, 2009 11:44 pm    Post subject:
Reply with quote

Hello,


Quote:
but must not create BASE.
Then the JCL posted will not work. As written, both files will be created whether they are opened and written or not. . .

To do what i believe you want, you would need to determine if one, the other, or both files are to be created and submit the appropriate jcl thru the Internal Reader (there are multiple Internal Reader topics in the forum).

This is actually a jcl question rather than a mq question.
Back to top
View user's profile Send private message
grabeva

New User


Joined: 07 Sep 2006
Posts: 23

PostPosted: Tue Oct 20, 2009 2:04 am    Post subject:
Reply with quote

the job open both files, and write in one of them.
but alloc both files. This i dont wont.....

i want to write the correct file, and not alloc de other one.

if a could help me?
use JCL?
o user dynamic alloc? who module? i never use dynamic alloc.

thks
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: Tue Oct 20, 2009 2:31 am    Post subject:
Reply with quote

Hello,

Please re-read my earlier post. . . The JCL you currently have cannot work.

One easy way to do what you want is to determine which file will actually be created and submit jcl "on the fly" (Internal Reader) that will create the one file you want and not the other. In this submitted jcl, the file to be written would be the definition as you have now - the "not-written" file could be defined as DUMMY.

Also, as i mentioned, there are many Internal Reader topics in the forum. If you find something that is not clear, post what you found and your doubt. SOmeone will be able to clarify.

Quote:
i never use dynamic alloc.
Most people have not. . . You can do what you want without using any kind of dynamic allocation in your code. . .
Back to top
View user's profile Send private message
grabeva

New User


Joined: 07 Sep 2006
Posts: 23

PostPosted: Wed Oct 21, 2009 4:21 am    Post subject:
Reply with quote

at the instalation couldnt run internal reader.....
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: Wed Oct 21, 2009 7:46 pm    Post subject:
Reply with quote

Hello,

I have never seen an installation that did not have the internal reader. . .

Someone may say "no", but the functionality is there. . .

If submitting the correct jcl is not permitted, then you can add additional steps to the existing job to conditionally execute depending on which file should be created. One step would determine which file is to be written and the the next 2 would be conditionally executed to only create the file that is needed.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Wed Oct 21, 2009 7:51 pm    Post subject:
Reply with quote

or change the program that reads mqs and writes:

rc=1 if first file is used
rc=2 if second file is used

next two steps delete a file based on condition code
or
use if logic.


cons for dynamic allocation by cobol program:
1. learning curve
2. very hard to document

pros for NOT using dynamic allocation
1. implemented changes are easy to test and debug
2. easily documented
3. jes output easy to audit and debug.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Wed Oct 21, 2009 8:04 pm    Post subject:
Reply with quote

in addition:

code to implement condition codes and the extra JCL will take about 15 mins to code and test.
code to implement dynamic will take about 15 days.
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 -> Java & MQSeries All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us