Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Move a field from one record location to another location

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Move a field from one record location to another location
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    Post subject: Reply to: Move a field from one record location to another l
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 Moderator


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

PostPosted: Thu Sep 03, 2009 9:59 pm    Post subject:
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:

http://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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us