using Symbolic in FINDREP



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

using Symbolic in FINDREP

Postby mathew28 » Mon Mar 19, 2012 11:23 pm

Hi,

I have created a JCL which uses the FINDREP to find and replace a string in a control card. And its working fine.
But need to use a symbolic inside the FINDREP to replace with the value in the symbolc.

//SETLVL SET FNAME=QC41223
//STEP01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=XXXX828.TEST.INFILE(EMLCARD),DISP=SHR
//SORTOUT DD DSN=XXXX828.TEST.OUTFILE(EMLOUT),DISP=SHR
//SYSIN DD *
OPTION COPY
OUTREC FINDREP=(IN=C'ERC.CSV',OUT=C'&FNAME'.CSV') /********** // OUTREC FINDREP=(IN=C'ERC.CSV',OUT=C'QC41223'.CSV') WORKED FINE"
/*

When I tried to executed the above JCL I'm getting Syntax error. is it possible to use Symbolic inside the control cards.. Please advice
mathew28
 
Posts: 30
Joined: Tue Oct 20, 2009 11:06 am
Has thanked: 0 time
Been thanked: 0 time

Re: using Symbolic in FINDREP

 

Re: using Symbolic in FINDREP

Postby Thomas Ramseier » Tue Mar 20, 2012 12:31 am

Hi Matthew
Maybe the sample below helps - although it is not exactly performing the requested function since the ".CSV"-ending is appended to the // SET-Variable:

// SET FNAME='QC41223.CSV'
//*-----------------------------------------------------------------
//STEP0100 EXEC PGM=SORT,
// PARM='JP1"&FNAME"'
//SORTIN DD *
ERC.CSV
/*
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTREC FINDREP=(IN=C'ERC.CSV',OUT=JP1)
/*
hth

Thomas
Thomas Ramseier
 
Posts: 16
Joined: Mon Sep 20, 2010 11:31 am
Has thanked: 0 time
Been thanked: 0 time

Re: using Symbolic in FINDREP

Postby mathew28 » Tue Mar 20, 2012 12:54 am

Thanks very much Thomas. It worked fine..

Thanks a lot !!
mathew28
 
Posts: 30
Joined: Tue Oct 20, 2009 11:06 am
Has thanked: 0 time
Been thanked: 0 time

Re: using Symbolic in FINDREP

Postby Frank Yaeger » Tue Mar 20, 2012 1:07 am

Note that you don't have to change FNAME to do it. You can use a DFSORT job like the following:

//SETLVL SET FNAME=QC41223
//S1 EXEC PGM=SORT,PARM='JP1"&FNAME..CSV"'
//SYSOUT DD SYSOUT=*
//SYMNOUT DD SYSOUT=*
//SORTIN DD *
ERC.CSV
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  OPTION COPY
  OUTREC FINDREP=(IN=C'ERC.CSV',OUT=JP1)
/*
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: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: using Symbolic in FINDREP

Postby mathew28 » Tue Mar 20, 2012 1:52 am

That was cool. Thanks very much Frank !
mathew28
 
Posts: 30
Joined: Tue Oct 20, 2009 11:06 am
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post