View previous topic :: View next topic
|
Author |
Message |
deb_parthas
New User
Joined: 24 Nov 2005 Posts: 18
|
|
|
|
Hi All,
I am trying to reformat a file wherein one field (position 399-401) needs to be moved to a new location(position 485-489). Since the new position is 5 bytes, it could be padded with zeros on left when the original field is anything but spaces. If the original field is spaces, nothing needs to be done.
The file is having and LRECL of 1400. I want to move only this particular field without disturbing any other fields. I am using ICEMAN do accomplish this. Could you kindly suggest an INREC/OUTREC statement do perform the same?
thanks,
Partha |
|
Back to top |
|
|
deb_parthas
New User
Joined: 24 Nov 2005 Posts: 18
|
|
|
|
To make it simpler..
Suppose the file has below fields and values.
----+----7----+----8----+----9----+----0---
99369 000655259 Y N 000 0
99369 000655259 Y N 000 0
99071 000031756 N N 030 A
99071 000031756 N N 030 A
99071 000031756 N N 030 A
00000 001811973 N N 0
00000 000033313 N N 0
00000 001811973 N N A
00000 000033313 N N 0
99369 000477763 Y N 4
99369 000477763 Y N 4
Need to make it look like below
----+----7----+----8----+----9----+----0---
99369 000655259 Y N 00000 0
99369 000655259 Y N 00000 0
99071 000031756 N N 00030 A
99071 000031756 N N 00030 A
99071 000031756 N N 00030 A
00000 001811973 N N 0
00000 000033313 N N 0
00000 001811973 N N A
00000 000033313 N N 0
99369 000477763 Y N 4
99369 000477763 Y N 4
The only field changing is from 99-101 to 90-95 for non-spaces values with leading zeros.
thanks |
|
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 want using the original positions you mentioned (399-401 and 485-489).
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/1400)
//SORTOUT DD DSN=... output file (FB/1400)
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(399,3,CH,NE,C' '),
OVERLAY=(485:399,3,UFF,EDIT=(TTTTT)))
/*
|
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080 |
|
Back to top |
|
|
|