Posted: Wed Sep 10, 2008 1:51 pm Post subject: converting data from one form to another
Hi,
I am having a file with the input shown below.
Code:
00000001923 C
00000357075 D
00000872666 D
00000880050 C
This is getting converted thru an Ezt as below.
Code:
0000000192L C
00000357075 D
00000872666 D
0000088005} C
Is there any built in function in SORT to convert the data like this ?
Note : If I use the hex on,the values of the above output are displaying like this.
Code:
0000000192L C
FFFFFFFFFFD444C
000000019230003
00000357075 D
FFFFFFFFFFF444C
000003570750004
00000872666 D
FFFFFFFFFFF444C
000008726660004
0000088005} C
FFFFFFFFFFD444C
000008800500003
Hex C0 thru C9 are positive numbers and D0 thru D9 are negative numbers. If your intention is to change the sign for negative numbers then it is very easy.
Use the following DFSORT JCL
Code:
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
00000001923 C
00000357075 D
00000872666 D
00000880050 C
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(18,1,CH,EQ,C'C'),
BUILD=(+0,SUB,1,11,ZD,ZDC,LENGTH=11,3X,18,1)),
IFTHEN=(WHEN=NONE,
BUILD=(1,11,3X,18,1))
/*
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