Page 1 of 1

Replacing JCL

PostPosted: Fri Dec 17, 2010 1:28 am
by GUI1504
Hello guys. I need a "replacing jcl".

In the first line in the 8 column, I have a string ('1234') and in all the lines below, And I have on the 5 column a string ('6789'). And i must replace all '6789' by '1234'. How can I do this?

Thanks

Re: Replacing JCL

PostPosted: Fri Dec 17, 2010 2:09 am
by dick scherrer
Hello,

There is no such thing as "a replacing jcl". . . JCL does only 1 thing - jcl invokes programs or PROCedures. . .

So, you will need to use some utility (unless you want to write some code of your own).

Many people use their sort product to do things like this. Which sort product / release is used on your system.

You need to post some sample input and the output you want from that sample input. Mention the dsorg and lrecl of both the input and output files.

There are also similar topics that have been answered in the sort parts forum (dfsort or syncsort) and you may find what you are looking for in a previous topic.

Re: Replacing JCL

PostPosted: Fri Dec 17, 2010 4:42 pm
by GUI1504
Yeah. I think use DFSORT program. I'll see...

Re: Replacing JCL

PostPosted: Sat Dec 18, 2010 12:33 am
by fidelis
Hi GUI,

If you want to use "DFSORT" is an option below.

//JOBNAME JOB .....
//SORT EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=FTPD.TEST.IN,DISP=OLD
//SORTOUT DD DSN=FTPD.TEST.OUT,DISP=(,CATLG,DELETE),
// SPACE=(TRK,(10,10),RLSE),UNIT=DISK,VOL=SER=WORK01,
// DCB=(LRECL=80,BLKSIZE=0,RECFM=FB,DSORG=PS)
//SYSIN DD *
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(5,4,SS,EQ,C'6789'),OVERLAY=(05:C'1234'))
//

Re: Replacing JCL

PostPosted: Sat Dec 18, 2010 1:26 am
by Akatsukami
Why do you think that Gui has a volume labeled "WORK01" at his site? How do you know that his data can be contained in 160 tracks, and consists of 80-byte records?

Re: Replacing JCL

PostPosted: Sat Dec 18, 2010 6:39 am
by Frank Yaeger
  OUTREC IFTHEN=(WHEN=(5,4,SS,EQ,C'6789'),OVERLAY=(05:C'1234'))


SS is not appropriate here. If you want to change '1234' in positions 5-8 to '6789' in positions 5-8, you would use:

  OUTREC IFTHEN=(WHEN=(5,4,CH,EQ,C'6789'),OVERLAY=(5:C'1234'))


SS is for finding a string anywhere in a record.
FINDREP is for finding and replacing a string anywhere in a record.
Finding and replacing a string at specific positions does not require either.

GUI1504,

If that's not what you want, then please explain more clearly what you do want. Show an example of your input records and what you expect for output. Explain the rules for getting from input to output. Give the RECFM and LRECL of your input file, and the starting position, length and format of each relevant field.