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
 
Selecting two copybooks of different length using parameters

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

New User


Joined: 04 Sep 2017
Posts: 7
Location: India

PostPosted: Tue Sep 05, 2017 7:28 pm    Post subject: Selecting two copybooks of different length using parameters
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10308
Location: italy

PostPosted: Tue Sep 05, 2017 7:49 pm    Post subject: Reply to: Selecting two copybooks of different length using parameters
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: 7
Location: India

PostPosted: Tue Sep 05, 2017 8:33 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10308
Location: italy

PostPosted: Tue Sep 05, 2017 8:41 pm    Post subject: Reply to: Selecting two copybooks of different length using parameters
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

Senior Member


Joined: 21 Sep 2010
Posts: 1788
Location: NY,USA

PostPosted: Tue Sep 05, 2017 9:17 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10308
Location: italy

PostPosted: Tue Sep 05, 2017 9:19 pm    Post subject: Reply to: Selecting two copybooks of different length using parameters
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: 252
Location: Cincinnati OH USA

PostPosted: Tue Sep 05, 2017 9:33 pm    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1788
Location: NY,USA

PostPosted: Tue Sep 05, 2017 9:34 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10308
Location: italy

PostPosted: Tue Sep 05, 2017 9:47 pm    Post subject: Reply to: Selecting two copybooks of different length using parameters
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.    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am
No new posts Length of Tape file Mohan Kothakota JCL & VSAM 9 Thu Apr 20, 2017 10:24 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts LISTCAT on a dataset with symbolic pa... shreya19 JCL & VSAM 5 Fri Apr 07, 2017 5:43 pm
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm

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