View previous topic :: View next topic
|
Author |
Message |
Neena John
New User
Joined: 20 Nov 2008 Posts: 13 Location: bangalore
|
|
|
|
Hi,
I have an input file .All the fields are delimited with
'|'.But in the input file,there can be instances where the character '|' appears inside the file data other than the delimiter.
Example
yyy|abcd|123|xxx
In the above example abcd|123 is the file data.I need to replace abcd|123 with abcd:123.
The above instance can appear anywhere based on the record.It depends on the data.
How do i replace the | in the data with : apart from delimiter which is also '|' using jcl ? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
/RANT ON
Once more let us clarify exactly what JCL is.
it is Job Control Language.
By itself it does nothing. It is used to invoke the chosen program and to define which datasets are to be used by the DD names associated with the chosen program.
JCL does not have magical powers that solve all problems, JCL is merely the vehicule for telling the processor which program you want it to execute.
/RANT OFF
So, if you might just care to tell us which program you wish the JCL to execute, we might be able to help you |
|
Back to top |
|
|
Neena John
New User
Joined: 20 Nov 2008 Posts: 13 Location: bangalore
|
|
|
|
I am looking for some utility which will replace '|' in the position say '10 to 15 (length 5)'
In the above example
abcd|123
It can also be a|123 in the file.This '|' can appear anywhere from position 10 to 15.
What is did first is that i separated all records from the input file where the '|' is coming in data other than the delimiter using include condition
include cond=(10,5,SS,EQ,C'|')
Now i need some utility for replacing '|' with :. |
|
Back to top |
|
|
sril.krishy
Active User
Joined: 30 Jul 2005 Posts: 183 Location: hyderabad
|
|
|
|
Neena John,
You can use the IFTHEN condition to replace the | with :.Please proivde the informantion on the SORT product that your system is having and the record format,lRECL etc...Give some dummy input and the expected out out as well.
Thanks
Krishy |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Because the solution for sort related questions may vary from product to product, please ensure that you state clearly which sort product you are using.
If you are not sure, then by running a simple sort step shown below, you will be able to find out for yourself.
If the messages start with ICE then your product is DFSORT and will be moved into the appropriate forum by one of the moderators. Please also post the output of the complete line which has a message code ICE201I, as this will enable our DFSORT experts to determine which release of DFSORT that you have installed. This may also affect the solution offered.
If the messages start with WER or SYT then the product is SYNCSORT and the topic will remain in the JCL forum by one of the moderators. Please also post the information telling which version of SYNCSORT is installed, as this may also affect the solution offered.
Thank you for taking your time to ensure that the valuable time of others is not wasted by offering inappropriate solutions which are not relevant due to the sort product being used and/or the release that is installed in your site.
Code: |
//SORTSTEP EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABC
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY |
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Neena,
Please be more careful when posting your requirement to get it right.
Quote: |
in the position say '10 to 15 (length 5)' |
10 to 15 would be length 6. 10 to 14 would be length 5.
abcd|123 would NOT fit in 10 to 14 or 10 to 15.
Assuming the positions are actually 10 to 14 and the input data looks something like this:
Code: |
*********abc|d*********
*********a|123*********
*********ab|cd*********
|
You can use a DFSORT job like the following to replace | with : in those positions:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
INREC FINDREP=(STARTPOS=10,ENDPOS=14,IN=C'|',OUT=C':')
/*
|
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080 |
|
Back to top |
|
|
Neena John
New User
Joined: 20 Nov 2008 Posts: 13 Location: bangalore
|
|
|
|
it uses SYNCSORT FOR Z/OS 1.3.1.1R .It is not supporting FINDREP also.
Any alternate utility for FINDREP? |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
Back to top |
|
|
|