Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Replace values in Dataset using JCL
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
Author Message
pravi_1985

New User


Joined: 02 Sep 2006
Posts: 11
Location: Chennai

PostPosted: Tue Aug 19, 2008 12:06 pm    Post subject: Replace values in Dataset using JCL
Reply with quote

Hi,

Can someone guide me how to download a dataset, replcae a word in the dataset & again reload the datset into the program, all using JCL program. Can the replcaing be done by DFSORT ? please help me out.
Back to top
View user's profile Send private message
References
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1130
Location: Mumbai - India

PostPosted: Tue Aug 19, 2008 12:15 pm    Post subject: Reply to: Replace values in Dataset using JCL
Reply with quote

Pravi,

Welcome to the forums.

Quote:
Can the replcaing be done by DFSORT ?


Yes.

What data do you want to replace and with what? Explain your requirement clearly.
Back to top
View user's profile Send private message
Moved: Tue Aug 19, 2008 12:20 pm by superk From JCL to DFSORT/ICETOOL
Anuj D.

Global Moderator


Joined: 22 Apr 2006
Posts: 2134
Location: Phoenix, AZ

PostPosted: Tue Aug 19, 2008 12:36 pm    Post subject: Re: Replace values in Dataset using JCL
Reply with quote

Hi,
pravi_1985 wrote:
Can someone guide me how to download a dataset, replcae a word in the dataset & again reload the datset into the program,
What does "download/reload" mean here ? Are you trying to get the DSN on "notepad" & then a replace ?

Quote:
all using JCL program.
It's contradictory, JCL is not a "program".. icon_confused.gif
Back to top
View user's profile Send private message
pravi_1985

New User


Joined: 02 Sep 2006
Posts: 11
Location: Chennai

PostPosted: Tue Aug 19, 2008 3:41 pm    Post subject:
Reply with quote

Hello Aaru,

Thanks for responding. I have few statements in the DSN say PRAVI.CNTL.JCL. 'RACF' is the word appearing in all those statements. I need to replace it by 'ACF2'. Can I do this by using DFSORT ?? If yes, then can you please give me the code. icon_smile.gif
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1130
Location: Mumbai - India

PostPosted: Tue Aug 19, 2008 3:46 pm    Post subject: Reply to: Replace values in Dataset using JCL
Reply with quote

Pravi,

Quote:
I have few statements in the DSN say PRAVI.CNTL.JCL.


How does your input file look like? Does it have DSN names in all the records?

You can use the FINDREP function of DFSORT to find and replace. Check if the PTF UK90013 is available.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 3506
Location: Brussels once more ...

PostPosted: Tue Aug 19, 2008 3:49 pm    Post subject:
Reply with quote

Have you considered using an ISPF macro, which has been suggested for the same question in the past, and there are a few good examples on the forum that I have seen.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 4574
Location: San Jose, CA

PostPosted: Tue Aug 19, 2008 8:55 pm    Post subject:
Reply with quote

Pravi,

If you want to replace every occurrence of 'RACF' anywhere in your records with 'ACF2', you can use DFSORT's new FINDREP function available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008). Assuming you want to replace the records in the original data set, you can use a DFSORT/ICETOOL job like this:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG   DD  SYSOUT=*
//IN DD DSN=PRAVI.CNTL.JCL,DISP=SHR
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=PRAVI.CNTL.JCL,DISP=OLD
//TOOLIN   DD    *
COPY FROM(IN) TO(T1) USING(CTL1)
COPY FROM(T1) TO(OUT)
/*
//CTL1CNTL DD *
  OPTION COPY
  INREC FINDREP=(IN=C'RACF',OUT=C'ACF2')
/*


Check the following to determine if you have the July, 2008 PTF:

http://ibmmainframes.com/viewtopic.php?t=33389

If you don't have z/OS DFSORT V1R5 PTF UK90013, ask your System Programmer to install it (it's free).

For complete details on the new FINDREP function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 648

PostPosted: Wed Aug 20, 2008 4:56 am    Post subject:
Reply with quote

Hi Frank,

are you saying you can now update PDS libraries without specifying the member names in the JCL ?

I can't test the new function FINDREP as it has not been installed.

Gerry
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 4574
Location: San Jose, CA

PostPosted: Wed Aug 20, 2008 5:09 am    Post subject:
Reply with quote

Quote:
are you saying you can now update PDS libraries without specifying the member names in the JCL ?


Huh? No. Where did I say that? I assumed the OP was asking about a PS data set, not a PDS. I read through the OP's notes again and I don't see any mention of a PDS. As previously, DFSORT can operate on a PDS(member), but not on all the members of a PDS at once.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 648

PostPosted: Wed Aug 20, 2008 5:27 am    Post subject:
Reply with quote

Hi Frank,

you are right, you didn't say it icon_redface.gif but I was basing it on the dataset name, usually CNTL names pertain to PDS and JCl is usually maintained in a PDS, that's why I asked.

I should have worded it differently.


Gerry
Back to top
View user's profile Send private message
pravi_1985

New User


Joined: 02 Sep 2006
Posts: 11
Location: Chennai

PostPosted: Wed Aug 20, 2008 12:03 pm    Post subject:
Reply with quote

sorry for the delay, but to be more specific, here are the specifications

Organization . . . : PS
Record format . . . : FB
Record length . . . : 178
Block size . . . . : 27946

A12345.TTRI.DATA.UDBB05M.UDBT48.UNLOAD is the name & JFCMMAP has to be replaced by JFC01AP. Can I even now, use the same program you gave me above ? Sorry to bug so much but I have started my career recently............. icon_confused.gif
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1130
Location: Mumbai - India

PostPosted: Wed Aug 20, 2008 12:43 pm    Post subject: Reply to: Replace values in Dataset using JCL
Reply with quote

Pravi,

Quote:
Can I even now, use the same program you gave me above ?


Yes, with few modifications.

DD name IN should have your input dataset. and the new FINDREP should be as shown below.



Code:
  INREC FINDREP=(IN=C'JFCMMAP',OUT=C'JFC01AP')


First check if you are able to use the FINDREP fucntion as it was recently introduced.
Back to top
View user's profile Send private message
pravi_1985

New User


Joined: 02 Sep 2006
Posts: 11
Location: Chennai

PostPosted: Wed Aug 20, 2008 2:45 pm    Post subject:
Reply with quote

Code:
COPY FROM(IN) TO(T1) USING(CTL1)


what is CTL1 ??

Code:
  //CTL1CNTL DD *   


is this statement correct as I am facing erros..... Can this be done in any other manner without using FINDREP ??
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1130
Location: Mumbai - India

PostPosted: Wed Aug 20, 2008 2:57 pm    Post subject: Reply to: Replace values in Dataset using JCL
Reply with quote

Pravi,

Quote:
what is CTL1 ??


It is the first four characters of the DFSORT control dataset which is CTL1CNTL in your case.

Quote:
is this statement correct as I am facing erros.....


Yeah, its correct. What issues are you facing?? POst the errors.

Quote:
Can this be done in any other manner without using FINDREP ??


Post the errors and then look for alternate solutions.
Back to top
View user's profile Send private message
pravi_1985

New User


Joined: 02 Sep 2006
Posts: 11
Location: Chennai

PostPosted: Wed Aug 20, 2008 3:50 pm    Post subject:
Reply with quote

Code:

//SORPRAV1 JOB ,,                                         
//  CLASS=I,MSGCLASS=X,                                   
//* COND=(4,LT),                                         
//* USER=Z430808,                                         
//  NOTIFY=????????,MSGLEVEL=(1,1),REGION=0M,             
//  TIME=1440,LINES=(999999,WARNING)                     
//PROCLIB  JCLLIB ORDER=(ICFS.IR3I.PROCLIB)               
//STD1     OUTPUT FORMS=UU01,CLASS=J,JESDS=ALL,DEFAULT=YES
//*****************************************               
//*DELETE THE FILES IF ALREADY EXISTING                   
//*****************************************               
//BB05M020 EXEC PGM=IEFBR14                               
//DD1      DD DSN=U019715.IR3I.DATA.UDBB05M.UDBT48.UNLOAD,
//         DISP=(MOD,DELETE,DELETE),SPACE=(TRK,1)         
//DD2      DD DSN=U019715.IR3I.DATA.UDBB05M.UDBT48.CNTL, 
//         DISP=(MOD,DELETE,DELETE),SPACE=(TRK,1)         
//*****************************************               
//*UNLOAD THE DATA                                       
//*****************************************               
//BB05M030 EXEC PGM=IKJEFT01                             
//STEPLIB  DD DISP=SHR,DSN=DB2.DEV.RUNLIB.LOAD           
//SYSPRINT DD SYSOUT=(,),OUTPUT=(*.STD1)                 
//UTPRINT  DD SYSOUT=(,),OUTPUT=(*.STD1)                 
//SYSUDUMP DD DUMMY                                       
//SYSTSPRT DD SYSOUT=(,),OUTPUT=(*.STD1)                 
//SYSTSIN  DD *                                           
DSN SYSTEM(DSND)                                         
     RUN PROGRAM (DSNTIAUL) -                             
         PLAN    (DSNTIAUL) PARMS('SQL')                 
 END                                                     
//SYSREC00 DD DSN=U019715.IR3I.DATA.UDBB05M.UDBT48.UNLOAD,
//         UNIT=(SYSDA,3),SPACE=(TRK,(1000,1000),RLSE),   
//         DISP=(NEW,CATLG,DELETE)                       
//SYSPUNCH DD DSN=U019715.IR3I.DATA.UDBB05M.UDBT48.CNTL,     
//         SPACE=(TRK,(1,1),RLSE),                           
//         UNIT=SYSDA,                                       
//         DISP=(NEW,CATLG,DELETE)                           
//SYSIN    DD *                                             
      SELECT * FROM ICD88DBA.JFCA6300;                       
//*****************************************                 
//*REPLCAING THE VALUES                                     
//*****************************************                 
//FINDREPL EXEC  PGM=ICETOOL                                 
//TOOLMSG  DD  SYSOUT=*                                     
//DFSMSG   DD  SYSOUT=*                                     
//IN DD DSN=U019715.IR3I.DATA.UDBB05M.UDBT48.UNLOAD,DISP=SHR
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)   
//OUT DD DSN=U019715.IR3I.DATA.UDBB05M.UDBT48.UNLOAD,DISP=OLD
//TOOLIN   DD    *                                           
COPY FROM(IN) TO(T1) USING(CTL1)                             
COPY FROM(T1) TO(OUT)                         
//CTL1CNTL DD *                               
  OPTION COPY                                 
  INREC FINDREP=(IN=C'JFCMMAP',OUT=C'JFC01AP')
/*


Above is my JCL ..............


[img]
SORPRAV1 FINDREPL - STEP WAS EXECUTED - COND CODE 0016
A12345.SORPRAV1.JOB63443.D0000108.? SYSOUT
A12345.SORPRAV1.JOB63443.D0000109.? SYSOUT
A12345.IR3I.DATA.UDBB05M.UDBT48.UNLOAD RETAINED, DDNAME=IN
A12345.IR3I.DATA.UDBB05M.UDBT48.UNLOAD RETAINED, DDNAME=OUT
A12345.SORPRAV1.JOB63443.D0000103.? SYSIN
A12345.SORPRAV1.JOB63443.D0000104.? SYSIN
STEP/FINDREPL/START 2008233.0533
STEP/FINDREPL/STOP 2008233.0533 CPU 0MIN 00.01SEC SRB 0MIN 00.00S
F40F ALLOCATED TO SYS00001
SYS08233.T053304.RA000.SORPRAV1.R0155702 KEPT
VOL SER NOS= STMP02.
SYS08233.T053243.RA000.SORPRAV1.T1.H01 DELETED, DDNAME=T1
JOB/SORPRAV1/START 2008233.0532
JOB/SORPRAV1/STOP 2008233.0533 CPU 0MIN 00.07SEC SRB 0MIN 00.00S
[/img]

this is the spool result................

can you please check & help me out ??
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 HoursGoto page 1, 2  Next
Page 1 of 2