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

Copy Replacing error IGYDS1089-S


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

New User


Joined: 25 May 2007
Posts: 61
Location: Coimbatore

PostPosted: Thu Jul 07, 2011 8:04 pm
Reply with quote

Hi,

I am trying to use the COPY REPLACING in my program. But, it is throwing some error. I guess this is because of the compiler which I am using.. Could anyone pls confirm and guide me what the compiler version needs to be used to support Relacing.

000108 01 WS-PONRCREF-LINKAGE.
000109 COPY PONRCREF REPLACING ==icon_razz.gif:== BY ==WS==.

It gave the error as

01 WS-PONRCREF-LINKAGE.
05 icon_razz.gif:-PONEFC-ENTRY.

==000109==> IGYDS1089-S "05" WAS INVALID. SCANNING WAS RESUMED AT THE NEXT AREA "A" ITEM, LEVEL-NUMBER, OR THE START OF THE NEXT CLAUSE.

Why the icon_razz.gif: is not replaced with WS. Please guide me.

Cobol Version: IBM ENTERPRISE COBOL FOR Z/OS 3.4.1
Compiler Version: I am not sure, how to find the compiler version.

Thanks
Pons
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Jul 07, 2011 8:21 pm
Reply with quote

COPY REPLACING has been around for many, many years so if you're using Enterprise COBOL, COPY REPLACING is part of it.

Be aware that COPY REPLACING does not do text replacement like a word processor. It does token replacement: variable names, things surrounded by a colon (or other special character), but not part of a variable name.
Back to top
View user's profile Send private message
Pons

New User


Joined: 25 May 2007
Posts: 61
Location: Coimbatore

PostPosted: Thu Jul 07, 2011 8:29 pm
Reply with quote

Yes Rob,

I used it for Token Replacement. I just trying to replace the icon_razz.gif: to WS. Thanks.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Jul 07, 2011 8:39 pm
Reply with quote

If you used it for token replacement, what was the starting character for the token? The starting and ending characters for the token MUST be the same -- colon, for example. Your original post is NOT using token replacement but string replacement, which does not work with COPY REPLACING.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Jul 07, 2011 8:41 pm
Reply with quote

And by the way,
Quote:
Cobol Version: IBM ENTERPRISE COBOL FOR Z/OS 3.4.1
Compiler Version: I am not sure, how to find the compiler version.
tells you the compiler version -- 3.4.1
Back to top
View user's profile Send private message
Pons

New User


Joined: 25 May 2007
Posts: 61
Location: Coimbatore

PostPosted: Thu Jul 07, 2011 8:52 pm
Reply with quote

The token is showing as a symbol after my post.
My Token is : and without spaces P and : and I am trying to replace it as WS..

01 WS-PONRCREF-LINKAGE.
COPY PONRCREF REPLACING ==(without space):(without space)P(without space):(without space)== BY ==WS==.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Jul 07, 2011 9:10 pm
Reply with quote

Copybook:
Code:
       01  WS-TEST-VARIABLE.
           05  :P:-DETAIL-01           PIC X(08).

Code:
Code:
       WORKING-STORAGE SECTION.
       COPY TEST1
            REPLACING ==:P:== BY ==WS==.
       PROCEDURE DIVISION                  .
results in
Code:
1PP 5655-G53 IBM Enterprise COBOL for z/OS  3.4.1               MF0189    Date 0
   LineID  PL SL  ----+-*A-1-B--+----2----+----3----+----4----+----5----+----6--
0  000001                IDENTIFICATION DIVISION.
   000002                PROGRAM-ID.                     MF0189.
   000003                ENVIRONMENT DIVISION.
   000004                CONFIGURATION SECTION.
   000005                SOURCE-COMPUTER.                IBM-370
   000006               *                                WITH DEBUGGING MODE
   000007                                                                   .
   000008                INPUT-OUTPUT  SECTION.
   000009                FILE-CONTROL.
   000010                DATA DIVISION.
   000011                FILE SECTION.
   000012                WORKING-STORAGE SECTION.
   000013                COPY TEST1
   000014                     REPLACING ==:P:== BY ==WS==.
   000015C               01  WS-TEST-VARIABLE.
   000016C                   05  WS-DETAIL-01           PIC X(08).
   000017C
   000018                PROCEDURE DIVISION                  .
so what you CLAIM you are doing works fine under Enterprise COBOL 3.4.1 - hence you are not giving us the entire picture.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Jul 07, 2011 9:14 pm
Reply with quote

use code tags and the bbcode will not replace the :char with an icon.

and had you used the preview button
(sorta like desk checking and referring to manuals)
you would have seen the icon replacement.
Back to top
View user's profile Send private message
Pons

New User


Joined: 25 May 2007
Posts: 61
Location: Coimbatore

PostPosted: Thu Jul 07, 2011 9:25 pm
Reply with quote

Cpy CHRRCREF:

Code:
000001            05  :P:-PWREFC-ENTRY.                             
000002                10 :P:-PWREFC-TRANS-FIELD            PIC X(25).
000003                10 :P:-PWREFC-TYPE                   PIC X(1).
000004                10 :P:-PWREFC-STATE-CD               PIC X(2).
000005                10 :P:-PWREFC-LOB-CD                 PIC X(3).
000006                10 :P:-PWREFC-PLS-FIELDS.                     
000007                   15 :P:-PWREFC-PLS-FIELD1          PIC X(25).
000008                   15 :P:-PWREFC-PLS-DESC1           PIC X(25).
000009                   15 FILLER                         PIC X(76).
.
.
.


Pgm:

Code:
000032        WORKING-STORAGE SECTION.
000108        01  WS-CHRRCREF-LINKAGE.                                       
000109            COPY CHRRCREF REPLACING ==:P:== BY ==WS==.


Error:
Code:
  000108                01  WS-CHRRCREF-LINKAGE.                               
  000109                    05  :P:-PWREFC-ENTRY.                               
                                                                               
==000109==> IGYDS1089-S "05" WAS INVALID.  SCANNING WAS RESUMED AT THE NEXT AREA "A" ITEM, LEVEL-NUMBER, OR THE START OF THE NEXT CLAUSE.         
==000109==> IGYDS0001-W A BLANK WAS MISSING BEFORE CHARACTER "P" IN COLUMN 20.   A BLANK WAS ASSUMED.

Is it help to figure it out?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Jul 07, 2011 10:37 pm
Reply with quote

Your copybook works for me:
Code:
5-G53 IBM Enterprise COBOL for z/OS  3.4.1               MF0189    Date 07/07/20
ID  PL SL  ----+-*A-1-B--+----2----+----3----+----4----+----5----+----6----+----
01                IDENTIFICATION DIVISION.
02                PROGRAM-ID.                     MF0189.
03                ENVIRONMENT DIVISION.
04                CONFIGURATION SECTION.
05                SOURCE-COMPUTER.                IBM-370
06               *                                WITH DEBUGGING MODE
07                                                                   .
08                INPUT-OUTPUT  SECTION.
09                FILE-CONTROL.
10                DATA DIVISION.
11                FILE SECTION.
12                WORKING-STORAGE SECTION.
13                COPY TEST1
14                     REPLACING ==:P:== BY ==WS==.
15C               01  WS-TEST-VARIABLE.
16C                   05  WS-DETAIL-01           PIC X(08).
17C
18                     COPY CHRRCREF REPLACING ==:P:== BY ==WS==.
19C        000001            05  WS-PWREFC-ENTRY.
20C        000002                10 WS-PWREFC-TRANS-FIELD            PIC X(25).
21C        000003                10 WS-PWREFC-TYPE                   PIC X(1).
22C        000004                10 WS-PWREFC-STATE-CD               PIC X(2).
23C        000005                10 WS-PWREFC-LOB-CD                 PIC X(3).
24C        000006                10 WS-PWREFC-PLS-FIELDS.
25C        000007                   15 WS-PWREFC-PLS-FIELD1          PIC X(25).
26C        000008                   15 WS-PWREFC-PLS-DESC1           PIC X(25).
27C        000009                   15 FILLER                         PIC X(76).
28                PROCEDURE DIVISION                  .
What compile options are set -- you can find them at the start of the compiler listing?
Back to top
View user's profile Send private message
Pons

New User


Joined: 25 May 2007
Posts: 61
Location: Coimbatore

PostPosted: Thu Jul 07, 2011 11:26 pm
Reply with quote

Below are enebled in my compiler

NOADATA
NOADV
APOST
ARITH(COMPAT)
AWO
BUFSIZE(4096)
NOCICS
CODEPAGE(1140)
NOCOMPILE(S)
NOCURRENCY
DATA(31)
NODATEPROC
DBCS
NODECK
NODIAGTRUNC
NODLL
NODUMP
NODYNAM
NOEXIT
NOEXPORTALL
FASTSRT
FLAG(I,I)
NOFLAGSTD
INTDATE(ANSI)
LANGUAGE(UE)
LIB
LINECOUNT(60)
NOLIST
MAP
NOMDECK
NONAME
NSYMBOL(NATIONAL)
NONUMBER
NUMPROC(MIG)
OBJECT
OFFSET
NOOPTIMIZE
OUTDD(SYSOUT)
PGMNAME(COMPAT)
RENT
RMODE(AUTO)
NOSEQUENCE
SIZE(MAX)
SOURCE
SPACE(1)
NOSQL
SQLCCSID
NOSSRANGE
NOTERM
NOTEST
NOTHREAD
TRUNC(BIN)
NOVBREF
NOWORD
XREF(SHORT)
YEARWINDOW(1900)
ZWB
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Jul 07, 2011 11:47 pm
Reply with quote

Are you running one of IBM's standard compile procedures (such as IGYWCL)? If not, you may need to contact your site support group and work with them since there is something unusual going on.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Jul 08, 2011 4:50 am
Reply with quote

Pons,

Can you post the whole program please, the compile listing (from the start of the source to the end of the procedure, and any remaining diagnostics at the end) would be best?

Check for any diagnostic messages at the start of the output listing. Check for any diagnostic messages before the WORKING-STORAGE SECTION.
Back to top
View user's profile Send private message
Pons

New User


Joined: 25 May 2007
Posts: 61
Location: Coimbatore

PostPosted: Fri Jul 08, 2011 7:09 am
Reply with quote

Thanks for all your help. You know I fixed this issue. I dont know how is it working. I just coded some thing differently by seeing some of the post in one of the site.

Code:
000032        WORKING-STORAGE SECTION.
000108        01  WS-CHRRCREF-LINKAGE.                                       
000109            COPY CHRRCREF REPLACING ==:P:== BY ==WS==.


Instead of above statement i gave it as

Code:
000032        WORKING-STORAGE SECTION.
000108        01  WS-CHRRCREF-LINKAGE.                                       
000109            COPY CHRRCREF REPLACING :P: BY WS.


It is working. I guess the delimitters made some twist. Thanks again!!!
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Jul 08, 2011 2:23 pm
Reply with quote

If that is all you changed, I'd suggest you raise a fault with the compiler.

How Robert's code works and yours doesn't is a mystery. If you can produce the source here, perhaps it can be tossed through a comiler (same and different) to try to recreate the 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: Fri Jul 08, 2011 6:07 pm
Reply with quote

I agree with Bill. There is something which is not yet told, look at these previous topics, talks about the similar issues, but they don't get resolved the way you say:

www.ibmmainframes.com/viewtopic.php?t=41418&highlight=replacing
www.ibmmainframes.com/viewtopic.php?t=33725&highlight=replacing
Back to top
View user's profile Send private message
Pons

New User


Joined: 25 May 2007
Posts: 61
Location: Coimbatore

PostPosted: Fri Jul 08, 2011 6:56 pm
Reply with quote

Due to some security reason. I can;t post my source here. Even I am working on it to find, why the actual statement is not working and how the modified statement is working...

Will update you once I find the answer. Thanks...
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Jul 08, 2011 7:30 pm
Reply with quote

Pons,

Can you briefly outline what the program does? Does it use DB2, CICS, (or go through some other pre-processor) VSAM files, QSAM, that sort of stuff.
Back to top
View user's profile Send private message
Pons

New User


Joined: 25 May 2007
Posts: 61
Location: Coimbatore

PostPosted: Sat Jul 09, 2011 2:57 am
Reply with quote

No Bill, It is just a batch cobol program which is called by the main program by passing some linkage sections. (No DB2 & No VSAM ...)

Even I deleted all my stuff and having only upto working storage section to check the COPY Replacing fuction, But even it didn;t work for me. Gave the same error.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Jul 09, 2011 12:28 pm
Reply with quote

Pons,

Can you try to compile the program Robert produced earlier?

Also, can you put in an 01-level with a PIC before the COPY, anything will do

Code:
01  W-SOME-NAME-JUST-TO-DEFINE-SOME-STORAGE PIC X.


so, follow that with the code for your COPY.

Do you think your organisation would be OK with you posting the completely stripped-down version of your program?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Jul 09, 2011 12:52 pm
Reply with quote

Quote:
Due to some security reason. I cant post my source here.

what a truckload of horse manure icon_cool.gif

if You work in a place where such high security is enforced
You should refrain from asking help on a public forum and hire a consultant with the proper security clearances :evil.

it is hard to believe that You cannot reproduce Your problem for US with a sanitized excerpt of Your data

we reply on our own time, free of charge
when asking for help You should be prepared to spend You/Yourself something,
which in this case is to spend some of Your precious time to create sanitized data so that we can help
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Sat Jul 09, 2011 6:42 pm
Reply with quote

Personally, I think we need to lock the topic. The code posted by the o/p that is claimed not to work has been proven to compile cleanly. Hence the problem is something specific to the site and there's no reason for us to worry about it any further.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Jul 09, 2011 7:56 pm
Reply with quote

Quote:
Personally, I think we need to lock the topic.


agreed and done icon_biggrin.gif
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts VB to VB copy - Full length reached SYNCSORT 8
Search our Forums:

Back to Top