|
|
| Author |
Message |
julian123
New User
Joined: 14 Aug 2006 Posts: 23
|
|
|
|
i have an input file, have to convert amty from pd to ch, and output as following. now i use 8,8,PD,EDIT=(SIIIIIIIIIIIIT.TT),SIGNS=(,-) to do the conversion, it works well.
but i don't know how to copy the first two lines to output file, can anybody help. thanks very much.
input
| Code: |
2008-05-28-14.11.14.635536 <- timestamp
NAME,AMTY <- field name
6M6100, <- data
FDFFFF600000100 <- hex value
646100B0000000C <- hex value
|
output
| Code: |
2008-05-28-14.11.14.635536
NAME,AMTY
6M6100, 100.00 |
|
|
| Back to top |
|
 |
References
|
Posted: Wed May 28, 2008 12:26 pm Post subject: Re: how to copy this two headers |
 |
|
|
 |
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 119 Location: Chennai
|
|
|
|
Hi ,
I just tried for these three records assuming the amount will always be the third record. I also tried to expand this assuming that the amount record will always be the record with record number as multiples of 3 but couldn't get the syntax of MOD (modulus) funtion right.
Here is the code which i used. This works if there are only 3 records. I am looking for something like WHEN=(71,8,ZD,MOD,=3,EQ,+0) i.e modulus of the seqnum divided by 3 should be zero. Sorry if i had deviated from the topic but just trying to experiment.
| Code: |
OPTION COPY
INREC OVERLAY=(71:SEQNUM,8,ZD)
OUTREC IFTHEN=(WHEN=(71,8,ZD,EQ,+3),
BUILD=(1,7,8,8,PD,EDIT=(SIIIIIIIIIIIIT.TT),SIGNS=(,-)))
|
|
|
| Back to top |
|
 |
Skolusu
DFSORT Developer
Joined: 07 Dec 2007 Posts: 242 Location: San Jose
|
|
|
|
Manuneedhi K,
Here is a DFSORT JCl which will give you the desired results
| Code: |
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
2008-05-28-14.11.14.635536
NAME,AMTY
2008-05-29-14.11.14.635536
NAME,AMTY
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(71:SEQNUM,8,ZD)),
IFTHEN=(WHEN=INIT,OVERLAY=(71:71,8,ZD,MOD,+3,TO=ZD,LENGTH=8)),
IFTHEN=(WHEN=(71,8,ZD,EQ,+0),
BUILD=(1,7,8,8,PD,EDIT=(SIIIIIIIIIIIIT.TT),SIGNS=(,-)))
/* |
|
|
| Back to top |
|
 |
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 119 Location: Chennai
|
|
|
|
| Thanks Kolusu. This is exactly what i was attempting but wasn't sure of the MOD syntax. |
|
| Back to top |
|
 |
|
|
|