Posted: Fri Apr 15, 2005 6:38 am Post subject: Find Character Double byte or Not
Hi,
I have a file of 360 bytes length. All these 360 characters are supposed to be Japanese Double Characters. I want to write the record if any of the character in the input is not a double byte character.
Double byte characters can be identified if first byte among the two bytes has hex code in between X'41' and X'FE',second byte can be any value.
Basically, I want to write the record if hex code of any byte at odd column does not fall in between X'41' and X'FE'.
I can write a cobol program for the same. I want to know whether I can achieve the same with any utility.
I don't have Ezytrieve in my shop.
Can anyone pls. help me in this regard.
Thanks
Siva Kumar Sunku.
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Fri Apr 15, 2005 7:46 am Post subject:
Siva Kumar Sunku,
Set up your valid sequence as symbols and use it to pick the records.I just showed for the first 20 hex sequence. You can eloborate it to include other sequences. Try this JCL.
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
DB1,X'4142434445464748494A4B4C4D4E4F'
DB2,X'5152535455565758595A5B5C5D5E5F'
//SORTIN DD DSN=YOUR DOUBLE BYTE CHARACTER FILE,
// DISP=SHR
//SORTOUT DD DSN=YOUR OUTPUT FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(1,1,SS,EQ,DB1,OR,1,1,SS,EQ,DB2,OR,
3,1,SS,EQ,DB1,OR,3,1,SS,EQ,DB2,OR,
5,1,SS,EQ,DB1,OR,5,1,SS,EQ,DB2,OR,
7,1,SS,EQ,DB1,OR,7,1,SS,EQ,DB2,OR,
... code for all odd bytes like above
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Fri Apr 15, 2005 11:16 am Post subject:
Siva,
With z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004), you can use DFSORT's new IFTHEN clauses to do what you want. Rather than hardcode all of the the IFTHEN conditions, we can use DFSORT's ICETOOL to generate them dynamically. Here's the DFSORT/ICETOOL job:
Code:
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//ONE DD *
DUMMY
/*
//IN DD DSN==... input file (FB/360)
//CT DD DSN=&&CT,UNIT=SYSDA,SPACE=(TRK,(5,5)),DISP=(,PASS)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(TRK,(5,5)),DISP=(,PASS)
//OUT DD DSN=... output file (FB/360)
//TOOLIN DD *
* Generate records with seqnums 003,005,..,357
COPY FROM(ONE) TO(CT) USING(CTL1)
* Generate control statements like this for nnn=003,005,...,357
* IFTHEN=(WHEN=(nnn,1,BI,LT,X'41',OR,nnn,1,BI,EQ,X'FF'),
* OVERLAY=(361:C'Y')),
COPY FROM(CT) USING(CTL2)
* Use the concatenated and generated control statements in
* CTL3CNTL as follows to select the records with invalid
* double-byte data:
* INREC IFTHEN=(WHEN=(001,1,BI,LT,X'41',OR,001,1,BI,EQ,X'FF'),
* OVERLAY=(361:C'Y')),
* IFTHEN=(WHEN=(003,1,BI,LT,X'41',OR,003,1,BI,EQ,X'FF'),
* OVERLAY=(361:C'Y')),
* ...
* IFTHEN=(WHEN=(357,1,BI,LT,X'41',OR,357,1,BI,EQ,X'FF'),
* OVERLAY=(361:C'Y')),
* IFTHEN=(WHEN=(359,1,BI,LT,X'41',OR,359,1,BI,EQ,X'FF'),
* OVERLAY=(361:C'Y'))
* OUTFIL FNAMES=OUT,INCLUDE=(361,1,CH,EQ,C'Y'),OUTREC=(1,360)
COPY FROM(IN) USING(CTL3)
/*
//CTL1CNTL DD *
OUTFIL FNAMES=CT,REPEAT=178,
OUTREC=(SEQNUM,3,ZD,START=3,INCR=2)
//CTL2CNTL DD *
OUTFIL FNAMES=T1,
OUTREC=(9:C'IFTHEN=(WHEN=(',1,3,
C',1,BI,LT,X''41'',OR,',
1,3,C',1,BI,EQ,X''FF''),',/,
17:C'OVERLAY=(361:C''Y'')),',80:X)
/*
//CTL3CNTL DD *
INREC IFTHEN=(WHEN=(001,1,BI,LT,X'41',OR,001,1,BI,EQ,X'FF'),
OVERLAY=(361:C'Y')),
/*
// DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
// DD *
IFTHEN=(WHEN=(359,1,BI,LT,X'41',OR,359,1,BI,EQ,X'FF'),
OVERLAY=(361:C'Y'))
OUTFIL FNAMES=OUT,INCLUDE=(361,1,CH,EQ,C'Y'),OUTREC=(1,360)
/*
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum