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
 

 

Multiple fields to single field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
mallik4u

New User


Joined: 17 Sep 2008
Posts: 75
Location: bangalore

PostPosted: Mon Apr 28, 2014 10:03 pm    Post subject: Multiple fields to single field
Reply with quote

Hi,

Can any one help me on how to acheive the following using SORT in a single step?

INPUT file:
123 456 789
012 345 678

OUTPUT:
123
456
789
012
345
678

Appretiate your help!

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

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Mon Apr 28, 2014 10:07 pm    Post subject: Reply to: Multiple fields to single field
Reply with quote

Look at the ICETOOL operator RESIZE.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Mon Apr 28, 2014 10:08 pm    Post subject:
Reply with quote

1.What is your input file length?
2.How many fields does 1 record contain (atmost)?
3.Will all the fields be filled always?
4.Is the field delimiter space?
5.What is your sort product ?
Back to top
View user's profile Send private message
mallik4u

New User


Joined: 17 Sep 2008
Posts: 75
Location: bangalore

PostPosted: Mon Apr 28, 2014 10:12 pm    Post subject:
Reply with quote

Thank you Bill and Pandora for quick reply.

Please find the details asked below:
1.What is your input file length?
14 characters
2.How many fields does 1 record contain (atmost)?
3 fields. Each field is 4 characters length.
3.Will all the fields be filled always?
Yes
4.Is the field delimiter space?
Yes
5.What is your sort product ?
Syncsort


Thanks,
Mallik
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Apr 28, 2014 10:13 pm    Post subject: Reply to: Multiple fields to single field
Reply with quote

here is a snippet that might help,

Code:
 ****** ***************************** Top of Data ******************************
 - - -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  2 Line(s) not Displayed
 000003 //*
 000004 //ICE     EXEC PGM=SORT
 000005 //SYSPRINT  DD SYSOUT=*
 000006 //SYSOUT    DD SYSOUT=*
 000007 //SORTIN    DD *
 000008 123 456 789
 000009 012 345 678
 000010 //SORTOUT   DD SYSOUT=*
 000011 //SYSIN     DD *
 000012   OPTION COPY
 000013   OUTFIL BUILD=(1,3,/,5,3,/,9,3)
 000014 //*
 ****** **************************** Bottom of Data ****************************


modify according to Your need,
You might want to consider also the RESIZE control statement
Back to top
View user's profile Send private message
mallik4u

New User


Joined: 17 Sep 2008
Posts: 75
Location: bangalore

PostPosted: Mon Apr 28, 2014 10:24 pm    Post subject:
Reply with quote

Thank you enrico.
your sample code worked for me.

Thanks,
Mallik
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Tue Apr 29, 2014 3:25 am    Post subject:
Reply with quote

Quote:
2.How many fields does 1 record contain (atmost)?
3 fields. Each field is 4 characters length


You will have to be cautious when length becomes 4 for any of your field upon using the above sort card.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
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 Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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