Page 1 of 1

JCL - COPYALL and REPLACE optio for comma

PostPosted: Mon Jul 07, 2008 11:50 am
by PRASAD
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=

Re: JCL - COPYALL and REPLACE optio for comma

PostPosted: Mon Jul 07, 2008 12:37 pm
by dick scherrer
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).

Re: JCL - COPYALL and REPLACE optio for comma

PostPosted: Mon Jul 07, 2008 2:21 pm
by PRASAD
Hi Dick..Sorry for my language....confusing.. It is working as expected with the X'6B'. Thanks for quick guidance.

Re: JCL - COPYALL and REPLACE optio for comma

PostPosted: Mon Jul 07, 2008 9:32 pm
by dick scherrer
Good to hear it is working :)

d