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

move one column value to another column in a sequential file


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

Active User


Joined: 27 Feb 2008
Posts: 110
Location: india

PostPosted: Wed Jul 21, 2010 9:27 pm
Reply with quote

Hello,

I have a sequential file and i want to move the value of the 10th column to the 11th column. Then the 10th column should fill in spaces.

for exp:

Before change:
Code:
FIELD10           FIELD11
3456              8786   
8970              9999   
6789              3434   

After change:
Code:
FIELD10           FIELD11
                  3456   
                  8970   
                  6789   
"Code'd"

If it is possible to fix this thru DF SORT, please someone can answer.

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: Wed Jul 21, 2010 10:54 pm
Reply with quote

Yes, but you need to tell me the starting position and length of the "10th column", the starting position and length of the "11th column", and the RECFM and LRECL of the input file.
Back to top
View user's profile Send private message
maxsubrat

Active User


Joined: 27 Feb 2008
Posts: 110
Location: india

PostPosted: Thu Jul 22, 2010 1:28 pm
Reply with quote

Starting position of the 10th column = 24 and Length = 4
Starting position of the 11th column = 28 and Length = 4

RECFM = F and LRECL = 46 in the input file

Thanks
Back to top
View user's profile Send private message
ssmukul

New User


Joined: 22 Jan 2008
Posts: 19
Location: India

PostPosted: Thu Jul 22, 2010 3:18 pm
Reply with quote

Hi,

Below sort card should work. Please try.
Code:
SORT FIELDS=COPY                     
OUTREC BUILD=(1,23,4X,28:24,4,32,15)

Thanks,
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Jul 22, 2010 7:07 pm
Reply with quote

ssmukul wrote:
Below sort card should work. Please try.
What will happen to the rest of the 'columns'?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 22, 2010 7:19 pm
Reply with quote

Hello,

Quote:
Below sort card should work. Please try.
You should test "solutions" before posting them to make sure the result meets the requirement. . .
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Jul 22, 2010 9:29 pm
Reply with quote

CICS Guy and dick scherrer,

What makes you think that ssmukul's control cards will NOT work? As per OP's latest request the output file will be 46 bytes and ssmukul did account for the right positions and length.

maxsubrat wrote:

Starting position of the 10th column = 24 and Length = 4
Starting position of the 11th column = 28 and Length = 4
RECFM = F and LRECL = 46 in the input file
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 22, 2010 9:41 pm
Reply with quote

Hi Kolusu,

I was responding to the "should work". I probably should have been more clear - i didn't mean to say/imply it would not work icon_redface.gif

Quote:
Below sort card should work. Please try.
What i meant to convey was that (for the most part - there's always an exception or 2), solutions need to be tested/verified before posting. Preferably showing the output gotten from the sample input.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Jul 22, 2010 9:59 pm
Reply with quote

Hi Kolusu,

As usual, I sometimes miss the obvious (1,23) and was thinking in terms of OVERLAY rather than just BUILD.... icon_redface.gif
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 Jul 22, 2010 10:49 pm
Reply with quote

Note that this could be done with OVERLAY as well like this:

Code:

  OPTION COPY                       
  INREC OVERLAY=(28:24,4,24:4X)     
Back to top
View user's profile Send private message
ssmukul

New User


Joined: 22 Jan 2008
Posts: 19
Location: India

PostPosted: Fri Jul 23, 2010 9:48 am
Reply with quote

Hi Dick,

I had tested the SORT card before posting. But sorry to write "should work". I will keep this in mind for future posts.

Thanks.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jul 23, 2010 7:24 pm
Reply with quote

Hi ssmukul,

Thanks for the follow-up icon_smile.gif

I often forget that "should" often means "does" here at the forum. . .

d
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 FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top