JCL - COPYALL and REPLACE optio for comma



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

JCL - COPYALL and REPLACE optio for comma

Postby PRASAD » Mon Jul 07, 2008 11:50 am

Please refer below JCL for replace option. This JCL is successfully replacing the 1st 2 chars from './' to '1/' and 4th char 'I' int 'U'. Refer the output for the result.

When I am trying to do for the conversion of ',' into '-', the out is showing ivalid value. Can we replac comma with other char in anyway using the below JCL and options.

//FILEAI6  EXEC PGM=FILEAID                       
//SYSPRINT DD   SYSOUT=*                         
//SYSLIST  DD   SYSOUT=*                         
//DD01     DD   *                                 
./ I'LL BE CHANGED                               
/. I WON'T BE                                     
/. I WON'T BE                                     
//DD01O    DD   SYSOUT=*                         
//SYSIN    DD *                                   
$$DD01     COPYALL IF=(1,EQ,C'./'),R=(1,C'!/'),   
                 ORIF=(4,EQ,C'I'),R=(4,C'U')     
/*                                               
//*     


The ouput is

****************************
!/ U'LL BE CHANGED
/. U WON'T BE
/. U WON'T BE
****************************

Error message for comma usage:

F I L E - A I D  V8.9.5  07 - JUL - 2008   13.35.27         *CONTROL CARD LIST
INSTALLATION  STANDARD CHARTERED BANK                  083338  RELEASE 02/27/0
     PROGRAM AND ALL MATERIAL COPYRIGHT 1980,2006 BY COMPUWARE CORPORATION   
1...5...10...15...20...25...30...35...40...45...50...55...60...65...70...75...
                                                                             
DD01     DSN=SRLSBPD.SRLSBPDB.JOB06248.D0000101.? OPENED AS PS,               
             RECFM=FB,LRECL=80,BLKSIZE=80,VOL=SYSOUT                         
DD01O    DSN=SRLSBPD.SRLSBPDB.JOB06248.D0000105.? OPENED AS PS,               
             RECFM=FB,LRECL=80,BLKSIZE=80,VOL=SYSOUT                         
$$DD01     COPYALL IF=(5,EQ,C','),R=(1,C'-'),                                 
1...5...10...15...20...25...30.                                               
INVALID DATA ELEMENT FORMAT IN IF, CHECK DATA STARTING IN COLUMN 31           
.....SKIPPING TO NEXT $$DD CARD                                          RC=4
                                                                             
0 RECORDS WRITTEN TO DD01O-SRLSBPD.SRLSBPDB.JOB06248.D0000105.?               
                       VOL=
PRASAD
 
Posts: 4
Joined: Mon Jul 07, 2008 11:28 am
Has thanked: 0 time
Been thanked: 0 time

Re: JCL - COPYALL and REPLACE optio for comma

Postby dick scherrer » Mon Jul 07, 2008 12:37 pm

Hello PRASAD and welcome to the forums,

Please post jcl and data using the "Code" tag to make your post align and be more readable.

The error posted is not from the "source" posted. . . :?

Instead of the character comma, you might try using a hex value (x'6b', if i recall).
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: JCL - COPYALL and REPLACE optio for comma

Postby PRASAD » Mon Jul 07, 2008 2:21 pm

Hi Dick..Sorry for my language....confusing.. It is working as expected with the X'6B'. Thanks for quick guidance.
PRASAD
 
Posts: 4
Joined: Mon Jul 07, 2008 11:28 am
Has thanked: 0 time
Been thanked: 0 time

Re: JCL - COPYALL and REPLACE optio for comma

Postby dick scherrer » Mon Jul 07, 2008 9:32 pm

Good to hear it is working :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post