sridbhav
New User
Joined: 07 May 2009 Posts: 2 Location: india
|
|
|
|
Hi , I have the below requirement. The record length of my dataset is 15. I want to search each record in the dataset for a particular word, if found I have to write 1 at the last byte of the output dataset, if not write 0 at the last byte of the output dataset.
Example:
Inpt Dataset ---> 15 Record length
Output dataset ---> 10 recl(first 1-3 bytes and 6-11 bytes of the input dataset and last byte has to be written based on the search)
Search value --> abc
Sample input
123456789777abc
188887778888888
Output expected
1236789770
1887778881 |
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hi,
What sort product do you have at your shop?
If it is DFSORT then you could use the below sort job,
Code: |
//JS020 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=WELLS.SORTIN.FB15
//SORTOUT DD DSN=WELLS.SORTOUT.FB10,DISP=OLD
//SYSOUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(SORTIN) TO(SORTOUT) USING(CTL1)
/*
//CTL1CNTL DD *
INREC IFOUTLEN=10,
IFTHEN=(WHEN=(13,3,CH,EQ,C'abc'),BUILD=(1:1,3,6,6,10:C'0')),
IFTHEN=(WHEN=(13,3,CH,NE,C'abc'),BUILD=(1:1,3,6,6,10:C'1'))
/*
//SYSUDUMP DD SYSOUT=*
/*
|
Hope it helps. |
|