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

COPH vs COPY command in a COBOL program


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rohin

New User


Joined: 29 Apr 2005
Posts: 21
Location: Gurgaon, India

PostPosted: Thu May 29, 2008 3:44 pm
Reply with quote

Hi,

In one of the existing Cobol programs, I saw command:

COPH LOGACTW.

Where LOGACTW is a copybook.

Could anyone please explain what exactly does COPH do and how is it different from normal cobol COPY command?

Thanks,
Rohin
Back to top
View user's profile Send private message
yogeshwar_ade

Active User


Joined: 31 Aug 2006
Posts: 103
Location: INDIA

PostPosted: Thu May 29, 2008 4:10 pm
Reply with quote

I hope it must COPY, not a COPH??? Is this code is runing???
Back to top
View user's profile Send private message
yogeshwar_ade

Active User


Joined: 31 Aug 2006
Posts: 103
Location: INDIA

PostPosted: Thu May 29, 2008 4:14 pm
Reply with quote

yogeshwar_ade wrote:
I hope it must COPY, not a COPH??? Is this code is runing???


As its in existing code, I wonder how this code is working.
I hope there is no such keyword used in cobol.


Correct me if I am wrong.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu May 29, 2008 4:33 pm
Reply with quote

A capital "H" is South Southeast of a capital "Y" on the keyboard.

Suffice to say this is a typo-error. icon_eek.gif
Back to top
View user's profile Send private message
piyush_is_here
Currently Banned

New User


Joined: 28 May 2008
Posts: 2
Location: NOIDA

PostPosted: Thu May 29, 2008 4:49 pm
Reply with quote

i have never seen anywhere COPH,
plz check the code it can't be compile/run
Back to top
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 275
Location: Bang,iflex

PostPosted: Thu May 29, 2008 5:02 pm
Reply with quote

HI,

Quote:

Suffice to say this is a typo-error.


That must be Typo error. other wise compile the program and see the result.
Back to top
View user's profile Send private message
yogeshwar_ade

Active User


Joined: 31 Aug 2006
Posts: 103
Location: INDIA

PostPosted: Thu May 29, 2008 5:12 pm
Reply with quote

vasanthkumarhb wrote:

That must be Typo error. other wise compile the program and see the result.



To avoid these kinds of small typo error, I always make 'HILITE COBOL ON'. If it is COBOL Keyword/Reserve word it will be in RED color (Default Color) else it will be in Green.

Also I hope if you are going to Compile this code it will surely gives Compile error.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu May 29, 2008 5:58 pm
Reply with quote

Hi,
yogeshwar_ade wrote:
To avoid these kinds of small typo error, I always make 'HILITE COBOL ON'.

Should I say, it could be site specific, I use "HI COB"...


rohin,
Quote:
In one of the existing Cobol programs

if so, you might like to check whether this
Quote:
COPH LOGACTW.
is an "active" statement of the program or not.
Back to top
View user's profile Send private message
yogeshwar_ade

Active User


Joined: 31 Aug 2006
Posts: 103
Location: INDIA

PostPosted: Fri May 30, 2008 10:13 am
Reply with quote

Anuj D. wrote:
Should I say, it could be site specific, I use "HI COB"...


'HI COB' is nothing but abbreviation of 'HILITE COBOL'.
Back to top
View user's profile Send private message
cvishu

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Mon Mar 17, 2014 9:11 pm
Reply with quote

HI i know its a very old thread , but curiously i just came accorss a live code that has the same statement COPH followed by a copybook name ( the copybook has a SQL statement).

Any clue as to what COPH does ?
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 Mar 17, 2014 9:17 pm
Reply with quote

Hello,

Post the output of a Clean Compile of this statement. Not the entire compile, just the bits concerning this.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Mon Mar 17, 2014 11:19 pm
Reply with quote

Without seeing the output requested by dick, another possibility is that COPH might be a reserved word in some of of pre-compile step.
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 Mar 18, 2014 12:19 am
Reply with quote

Hello,

Searched in the DB2 and CICS manuals and COPH is not found.

Possibly it is some other vendor's "front end" . . .
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Tue Mar 18, 2014 6:46 am
Reply with quote

Did you check the compile listing? Please share the screen shot of that.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Mar 18, 2014 2:38 pm
Reply with quote

Quote:
Please share the screen shot of that

No - do not do a screenshot - a cut and paste using the code tags is quicker and more efficient file-size wise.
Back to top
View user's profile Send private message
jagadishts

New User


Joined: 30 Sep 2019
Posts: 1
Location: India

PostPosted: Mon Sep 30, 2019 4:10 pm
Reply with quote

This is not a Typo. COPH is used to copy host variables into EXEC SQL statement block.

EXEC SQL
SELECT VAR1, VAR2 FROM TABLE1
COPH DB001
WHERE VAR3 = XXX
EXEC-END

where DB001 may contain
INTO :WS-VAR1, :WS-VAR2
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Mon Sep 30, 2019 11:51 pm
Reply with quote

Quote:
where DB001 may contain
So you are not sure then and doing a guess work, you can do the same by using COPY/INCLUDE. Do you have a link to the manual which explains COPH?
Besides, Please don't tailgate any old trade, if you want to discuss something then start a new topic.
Moderators, Please lock this topic.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top