View previous topic :: View next topic
|
Author |
Message |
Sysaron
New User
Joined: 28 Sep 2005 Posts: 55 Location: USA
|
|
|
|
Hi all,
I'm wondering if any of you know of a utility that can do the following....without spending very much time on this....
1) file is 400 bytes.
2) the 1st record is a "rollyear" record and only contains data in bytes 14-20 something like 2005000 and the rest of the record contains packed 0 or spaces. It is the same format as the rest of the records
3) all other records contain data in the fields,...not 0.
4) Without doing it manually, can the that 1st record be updated to Add 1 to the year in bytes 14-17 and write out all other records as is? So, for this sample file the new output would be 2006000 in bytes 14-20.
If you know of an "easy" way, without writing a program or without "hard coding" the value, please let me know.
Thank-you, |
|
Back to top |
|
|
Sysaron
New User
Joined: 28 Sep 2005 Posts: 55 Location: USA
|
|
|
|
I forgot to post a sample of the file data. Here it is:
.............2005000 .........................................................
0000000000000FFFFFFF444000000000000000000000000000000000000000000000000000000000
00000C000C00C2005000000000000C000000C000000C000000C000000C000000C000000C000000C0
------------------------------------------------------------------------------
.. .........%2005000 ....................*......*.............................
0040032000006FFFFFFF444000000000000000000505000050500000000000000000000000000000
20010C051C01C2005000000000000C000000C000180C000180C000000C000000C000000C000000C0
------------------------------------------------------------------------------
.. .........%2005000 ....................%......%.............................
0040082000006FFFFFFF444000000000000000000416000041600000000000000000000000000000
20012C051C01C2005000000000000C000000C000255C000255C000000C000000C000000C000000C0
------------------------------------------------------------------------------
.. .........%2005001 ....................)......@.............................
0040082000006FFFFFFF444000000000000000000065000006700000000000000000000000000000
20012C041C01C2005001000000000C000000C000005D000093C000000C000000C000000C000000C0 |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/400)
//SORTOUT DD DSN=... output file (FB/400)
//SYSIN DD *
OPTION COPY
INREC IFOUTLEN=400,
IFTHEN=(WHEN=INIT,OVERLAY=(401:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(401,8,ZD,EQ,+1),
OVERLAY=(14:14,4,ZD,ADD,+1,TO=ZD,LENGTH=4))
/*
|
|
|
Back to top |
|
|
Sysaron
New User
Joined: 28 Sep 2005 Posts: 55 Location: USA
|
|
|
|
Frank,
That really works great!
Thanks!
Sysaron |
|
Back to top |
|
|
Sysaron
New User
Joined: 28 Sep 2005 Posts: 55 Location: USA
|
|
|
|
Frank,
I understand most of the input statements, but why use 401 in these two areas please?
IFTHEN=(WHEN=INIT,OVERLAY=(401:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(401,8,ZD,EQ,+1),
Sysaron |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You said "file is 400 bytes". Since we only need the sequence number temporarily to check for record number 1, we put it at the end of the record (positions 401-408) and remove it (with IFOUTLEN=400) when we're done with it. |
|
Back to top |
|
|
|