View previous topic :: View next topic
|
Author |
Message |
Priyanka Pyne
New User
Joined: 09 Feb 2008 Posts: 95 Location: India
|
|
|
|
Hi,
I am trying to modify a FILE1 through JCL which is created say in setp01.
In step02 I want to change first two line of that FILE1 with two specific lines. I don't want to do it manually since this needs to be done for 11 files. Also I don't want to write any COBOL code.
But, really not sure if this can be done using JCL. Any help will be great. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
No, because JCL merely informs the CPU which program to process and which files to use.
So you will need to write some sort of code at some stage
SAS, REXX, ISPF Edit, SORT, COBOL, PL/1 ......... whatever |
|
Back to top |
|
|
Priyanka Pyne
New User
Joined: 09 Feb 2008 Posts: 95 Location: India
|
|
|
|
Can I do this using Sort? if yes can you show me some path? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
You need to tell us EXACTLY what it is that you want to do to get any useful assistance. |
|
Back to top |
|
|
Priyanka Pyne
New User
Joined: 09 Feb 2008 Posts: 95 Location: India
|
|
|
|
I have one control card
In that file the first two lines are
Code: |
LOAD DATA LOG NO INDDN SYSREC00 INTO TABLE
XXX.TABLE |
I want to modify this with
Code: |
LOAD DATA INDDN SYSREC REPLACE LOG NO NOCOPYPEND
INTO TABLE XXX.TABLE |
This control card is getting generated in step1. And I am using it in step2. But before using I want to do the above modification. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Code: |
OPTION COPY
INREC IFTHEN=(WHEN=(1,42,CH,EQ,
C'LOAD DATA LOG NO INDDN SYSREC00 INTO TABLE'),
OVERLAY=(C'LOAD DATA INDDN SYSREC REPLACE LOG NO NOCOPYPEND')),
IFTHEN=(WHEN=NONE,BUILD=(C'INTO TABLE',5,63))
|
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Why not just generate the card correctly in STEP1 |
|
Back to top |
|
|
Priyanka Pyne
New User
Joined: 09 Feb 2008 Posts: 95 Location: India
|
|
|
|
Thanks. It worked. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You mean correcting STEP1? It is the best option. |
|
Back to top |
|
|
Priyanka Pyne
New User
Joined: 09 Feb 2008 Posts: 95 Location: India
|
|
|
|
No. I did what Bill suggested. Because correcting Step1 is not possible as it is getting generated automaticcaly while I am taking unload of table. |
|
Back to top |
|
|
Priyanka Pyne
New User
Joined: 09 Feb 2008 Posts: 95 Location: India
|
|
|
|
Another problem I am facing.
I used the below card
Code: |
IFTHEN=(WHEN=(7,4,CH,EQ,C'WLTC'),
OVERLAY=(C'EFGH ')) |
Input:
I expected
But it is coming as
Someone please put some light on it |
|
Back to top |
|
|
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
Try this.
Code: |
IFTHEN=(WHEN=(7,4,CH,EQ,C'WLTC'),
BUILD=(1,6,C'EFGH',11,10)) |
YOu cam make use of FINDREP also for this requirement |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Priyanka,
If you don't specify a Column in OVERLAY, the default is "1". There is no "where I want it to go, could be different each time" default.
Code: |
IFTHEN=(WHEN=(7,4,CH,EQ,C'WLTC'),
OVERLAY=(7:C'EFGH')) |
Quote: |
You cam make use of FINDREP also for this requirement |
Chandan,
BUILD will always generate a new version of a record. OVERLAY won't unless the record is extended. BUILD always has to specify fields for all the data and the thing being changed. OVERLAY only the things being changed, so less open to typos and other assorted mistakes.
Why would you use FINDREP for that? |
|
Back to top |
|
|
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
Bill,
Apologies..my posy bit unclear..
I meant to say if Priyanka doesn't want to make use of IFTHEN BUILD,she can make use of FINDREP also..
Thanks for explanation on Build and overlay..
Will keep in mind that if we are not going to extend the record its better to use overlay
Regards,
Chandan |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Ok, but FINDREP is FIND and REPlace. IFTHEN=(WHEN=(logexp is "it's here, I don't need to go searching for it" (if not using SS as a fieldtype).
It will make the code less clear (and slower) to use FINDREP where IFTHEN is much more obvious. |
|
Back to top |
|
|
chandan.inst
Active User
Joined: 03 Nov 2005 Posts: 275 Location: Mumbai
|
|
|
|
Yes Bill..Agree with you ..Thanks |
|
Back to top |
|
|
Priyanka Pyne
New User
Joined: 09 Feb 2008 Posts: 95 Location: India
|
|
|
|
Thank you all. Overlay worked for me. I think we can use the following as well.
Code: |
INREC OVERLAY=(5:5,5,CHANGE=(5,C'12345',C'ABCDE'),NOMATCH=(5,5)) |
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Yes, CHANGE would be possible. However, again I think it loses clarity as CHANGE would usually be fore more than one transformation.
CHANGE doesn't get used nearly enough, so good work in getting to it. |
|
Back to top |
|
|
|