IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

get message and write a file depending on data in message


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Mon Oct 19, 2009 11:44 pm
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
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

Moderator Emeritus


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

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

at the instalation couldnt run internal reader.....
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Oct 21, 2009 7:46 pm
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: 6966
Location: porcelain throne

PostPosted: Wed Oct 21, 2009 7:51 pm
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: 6966
Location: porcelain throne

PostPosted: Wed Oct 21, 2009 8:04 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 2
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
Search our Forums:

Back to Top