Replacing JCL



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

Replacing JCL

Postby GUI1504 » Fri Dec 17, 2010 1:28 am

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
GUI1504
 
Posts: 28
Joined: Fri Sep 03, 2010 10:40 pm
Location: Campinas, SP - Brazil
Has thanked: 0 time
Been thanked: 0 time

Re: Replacing JCL

Postby dick scherrer » Fri Dec 17, 2010 2:09 am

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.
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: Replacing JCL

Postby GUI1504 » Fri Dec 17, 2010 4:42 pm

Yeah. I think use DFSORT program. I'll see...
GUI1504
 
Posts: 28
Joined: Fri Sep 03, 2010 10:40 pm
Location: Campinas, SP - Brazil
Has thanked: 0 time
Been thanked: 0 time

Re: Replacing JCL

Postby fidelis » Sat Dec 18, 2010 12:33 am

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'))
//
fidelis
 
Posts: 7
Joined: Thu Dec 16, 2010 1:01 am
Location: Brazil
Has thanked: 0 time
Been thanked: 0 time

Re: Replacing JCL

Postby Akatsukami » Sat Dec 18, 2010 1:26 am

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?
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Replacing JCL

Postby Frank Yaeger » Sat Dec 18, 2010 6:39 am

  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.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post