IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Move a field from one record location to another location


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
deb_parthas

New User


Joined: 24 Nov 2005
Posts: 18

PostPosted: Thu Sep 03, 2009 4:16 pm
Reply with quote

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
View user's profile Send private message
deb_parthas

New User


Joined: 24 Nov 2005
Posts: 18

PostPosted: Thu Sep 03, 2009 4:54 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Sep 03, 2009 9:59 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Mainframe openings in Techmahnidra fo... Mainframe Jobs 0
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top