Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Can we modify a PS file in JCL?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Priyanka Pyne

New User


Joined: 09 Feb 2008
Posts: 95
Location: India

PostPosted: Thu Feb 14, 2013 3:16 pm    Post subject: Can we modify a PS file in JCL?
Reply with quote

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
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Feb 14, 2013 3:18 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Priyanka Pyne

New User


Joined: 09 Feb 2008
Posts: 95
Location: India

PostPosted: Thu Feb 14, 2013 3:22 pm    Post subject:
Reply with quote

Can I do this using Sort? if yes can you show me some path?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Feb 14, 2013 3:45 pm    Post subject:
Reply with quote

You need to tell us EXACTLY what it is that you want to do to get any useful assistance.
Back to top
View user's profile Send private message
Priyanka Pyne

New User


Joined: 09 Feb 2008
Posts: 95
Location: India

PostPosted: Thu Feb 14, 2013 3:49 pm    Post subject: Reply to: Can we modify a PS file in JCL?
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Thu Feb 14, 2013 4:08 pm    Post subject: Reply to: Can we modify a PS file in JCL?
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Feb 14, 2013 4:19 pm    Post subject:
Reply with quote

Why not just generate the card correctly in STEP1
Back to top
View user's profile Send private message
Priyanka Pyne

New User


Joined: 09 Feb 2008
Posts: 95
Location: India

PostPosted: Thu Feb 14, 2013 5:49 pm    Post subject: Reply to: Can we modify a PS file in JCL?
Reply with quote

Thanks. It worked.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Thu Feb 14, 2013 6:05 pm    Post subject: Reply to: Can we modify a PS file in JCL?
Reply with quote

You mean correcting STEP1? It is the best option.
Back to top
View user's profile Send private message
Priyanka Pyne

New User


Joined: 09 Feb 2008
Posts: 95
Location: India

PostPosted: Thu Feb 14, 2013 6:45 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Priyanka Pyne

New User


Joined: 09 Feb 2008
Posts: 95
Location: India

PostPosted: Fri Feb 15, 2013 1:33 pm    Post subject: Reply to: Can we modify a PS file in JCL?
Reply with quote

Another problem I am facing.

I used the below card
Code:
IFTHEN=(WHEN=(7,4,CH,EQ,C'WLTC'),
OVERLAY=(C'EFGH    '))           


Input:
Code:
     WLTCSYSX.table


I expected
Code:
      EFGHSYSX.table


But it is coming as
Code:
EFGH    TCSYSX.Table


Someone please put some light on it
Back to top
View user's profile Send private message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 269
Location: Mumbai

PostPosted: Fri Feb 15, 2013 1:48 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Fri Feb 15, 2013 2:02 pm    Post subject:
Reply with quote

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
View user's profile Send private message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 269
Location: Mumbai

PostPosted: Fri Feb 15, 2013 2:08 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Fri Feb 15, 2013 2:17 pm    Post subject: Reply to: Can we modify a PS file in JCL?
Reply with quote

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
View user's profile Send private message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 269
Location: Mumbai

PostPosted: Fri Feb 15, 2013 3:11 pm    Post subject:
Reply with quote

Yes Bill..Agree with you ..Thanks
Back to top
View user's profile Send private message
Priyanka Pyne

New User


Joined: 09 Feb 2008
Posts: 95
Location: India

PostPosted: Fri Feb 15, 2013 3:30 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Fri Feb 15, 2013 4:33 pm    Post subject: Reply to: Can we modify a PS file in JCL?
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us