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

Selecting two copybooks of different length using parameters


IBM Mainframe Forums -> COBOL Programming
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
Vignesh Sid

New User


Joined: 04 Sep 2017
Posts: 43
Location: India

PostPosted: Tue Sep 05, 2017 7:28 pm
Reply with quote

I am working on a DB2 batch module which involves MQ handling. There are two copybooks (one for test and another for prod) declared under a 01- variable as follows:

01 MQM-OBJECT-DESCRIPTOR EXTERNAL.
PROD COPY TECMQODL.
TEST * COPY CMQODL.
EJECT

The above two copybooks are different in length and layout though there are some common variables too....

This 01- variable can take only one copybook at a time either prod or test. I have passed a parameter to this module to determine environment is test or prod.

Using this parameter, is there any way to select the desired copybook generically, instead of commenting every time? In short can I use the test or prod copybook as 88- variable.....

Please let me know for any possible solution.

Thanks in advance!
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Sep 05, 2017 7:49 pm
Reply with quote

NO SOLUTION and pretty inconsiderate approach

You want to run in prod something different from what You have tested
Back to top
View user's profile Send private message
Vignesh Sid

New User


Joined: 04 Sep 2017
Posts: 43
Location: India

PostPosted: Tue Sep 05, 2017 8:33 pm
Reply with quote

Thanks Enrico for quick reply. The two copybooks are not entirely different. It has the same variables except copybook CMQODL has been temporarily changed to have the version 3 layout of 336 bytes as opposed to the latest layout of version 4 with 400 bytes.

So Its not entirely different in Prod from test. For example we can consider both the copybooks are for test and I need to select between the two based on the desired parameter. So are there any chances of changing the way the 01- block is declared.

01 MQM-OBJECT-DESCRIPTOR EXTERNAL.
COPY TECMQODL.
* COPY CMQODL.
EJECT

Just a curiosity to find a solution!
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Sep 05, 2017 8:41 pm
Reply with quote

it does not matter what the differences are ...
You still want to run in production something different from what You have tested
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3049
Location: NYC,USA

PostPosted: Tue Sep 05, 2017 9:17 pm
Reply with quote

1.You can keep same name but give different VALUES to them, will that work?
2. Talk to Scheduling team, they can set a parameter and pass on to the job based on environment.
3. You said it is DB2 then you can check like this,
Code:
EXEC SQL                         
     SELECT CURRENT SERVER       
       INTO :WS-SYS-NAME       
       FROM SYSIBM.SYSDUMMY1     
END-EXEC
IF WS-SYS-NAME     = PROD
  copybook1
ELSE copybook2
END   
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Sep 05, 2017 9:19 pm
Reply with quote

they might still be running different things in different environments
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Tue Sep 05, 2017 9:33 pm
Reply with quote

Quote:
Using this parameter, is there any way to select the desired copybook generically, instead of commenting every time? In short can I use the test or prod copybook as 88- variable.....


Am I missing something?

The program is already compiled. Copybook has already been determined before executing.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3049
Location: NYC,USA

PostPosted: Tue Sep 05, 2017 9:34 pm
Reply with quote

Quote:
The program is already compiled. Copybook has already been determined before executing.
TS is passing the parameter run time to determine that. Or sometimes Ts is playing around commenting the code accordingly and that wants it to be automated.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Sep 05, 2017 9:47 pm
Reply with quote

topic locked, getting nowhere icon_cool.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts Passing Parameters to Programs Invoke... PL/I & Assembler 5
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
Search our Forums:

Back to Top