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 one column value to another column in a sequential file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
maxsubrat

New User


Joined: 27 Feb 2008
Posts: 72
Location: india

PostPosted: Wed Jul 21, 2010 9:27 pm    Post subject: move one column value to another column in a sequential file
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 Moderator


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

PostPosted: Wed Jul 21, 2010 10:54 pm    Post subject:
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

New User


Joined: 27 Feb 2008
Posts: 72
Location: india

PostPosted: Thu Jul 22, 2010 1:28 pm    Post subject: Reply to: move one column value to another column in a seque
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Thu Jul 22, 2010 7:07 pm    Post subject:
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

Site Director


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

PostPosted: Thu Jul 22, 2010 7:19 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Jul 22, 2010 9:41 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Thu Jul 22, 2010 9:59 pm    Post subject:
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 Moderator


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

PostPosted: Thu Jul 22, 2010 10:49 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Jul 23, 2010 7:24 pm    Post subject: Reply to: move one column value to another column in a seque
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    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
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 File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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