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
 

 

split columns into different output files

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

New User


Joined: 21 May 2009
Posts: 18
Location: Mumbai

PostPosted: Wed Jun 03, 2009 4:46 pm    Post subject: split columns into different output files
Reply with quote

input
------
111 abc
222 def

output1
---------
111
222

output2
---------
abc
def

i want to split my input file into 2 output files using sort utility...
i tried giving
//sysin dd*
dort fields=copy
outfil fnames=out1,outrec=(1:1,3)
/*
but doesnt seem to work..please help
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 03, 2009 5:06 pm    Post subject:
Reply with quote

Quote:
but doesnt seem to work..please help

Is not really much information for us to go on really.

Psychic day was Monday this week, so
Please post the output from the run, and the recfm & lrecl of the input file.
Back to top
View user's profile Send private message
rafael2009

New User


Joined: 21 May 2009
Posts: 18
Location: Mumbai

PostPosted: Wed Jun 03, 2009 5:09 pm    Post subject:
Reply with quote

i have my input file as below
input
------
111 abc
222 def

now i need to split the input file into 2 output files with respect to the colums. as shown below:

output1
---------
111
222

output2
---------
abc
def

can anyone suggest me the sort card with sort utility
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2165
Location: @my desk

PostPosted: Wed Jun 03, 2009 5:12 pm    Post subject:
Reply with quote

Quote:
Please post the output from the run, and the recfm & lrecl of the input file.
rafael2009

You cant expect others to guess your requirement and post a solution for you. So please post the requested info.
Back to top
View user's profile Send private message
rafael2009

New User


Joined: 21 May 2009
Posts: 18
Location: Mumbai

PostPosted: Wed Jun 03, 2009 5:17 pm    Post subject:
Reply with quote

ohh sorry ..i dint see that sentence .... my outup is rc 16 with error saying f record type is F - data startes in position 1. 3 byte fixed record length is not equal to 80 lrecl for out1 ....

my files are of FB with lrecl = 80
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 03, 2009 5:22 pm    Post subject:
Reply with quote

CUT & PASTE IT
Back to top
View user's profile Send private message
rafael2009

New User


Joined: 21 May 2009
Posts: 18
Location: Mumbai

PostPosted: Wed Jun 03, 2009 5:29 pm    Post subject: Reply to: split columns into different output files
Reply with quote

1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 12:49 ON WED JUN
SORT FIELDS=COPY
OUTFIL FNAMES=O1,OUTREC=(1:1,3)
F RECORD TYPE IS F - DATA STARTS IN POSITION 1
0 3 BYTE FIXED RECORD LENGTH IS NOT EQUAL TO 80 BYTE LRECL FOR O1
0 C5-K90013 C6-K90013 C7-K90000 C8-K90013 E9-K90013 E7-K24705
3 END OF DFSORT
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 03, 2009 5:33 pm    Post subject:
Reply with quote

And now dare I ask that you post the JCL that you submitted.
Back to top
View user's profile Send private message
rafael2009

New User


Joined: 21 May 2009
Posts: 18
Location: Mumbai

PostPosted: Wed Jun 03, 2009 5:35 pm    Post subject:
Reply with quote

icon_biggrin.gif

//S1 EXEC PGM=SORT
//SORTIN DD DSN=Dsn.SORT1,DISP=SHR
//O1 DD DSN=Dsn.SORT2,DISP=OLD
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=O1,OUTREC=(1:1,3)
/*
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 03, 2009 5:40 pm    Post subject:
Reply with quote

What is the recfm / lrecl of the output file
Back to top
View user's profile Send private message
rafael2009

New User


Joined: 21 May 2009
Posts: 18
Location: Mumbai

PostPosted: Wed Jun 03, 2009 5:42 pm    Post subject:
Reply with quote

FB 80
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 03, 2009 5:46 pm    Post subject:
Reply with quote

try
Code:

outfil fnames=out1,outrec=(1,3,77X)


You need to fill the rest of the record with blanks.
Back to top
View user's profile Send private message
rafael2009

New User


Joined: 21 May 2009
Posts: 18
Location: Mumbai

PostPosted: Wed Jun 03, 2009 6:14 pm    Post subject:
Reply with quote

Thanks a lot expat.....
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 Jun 03, 2009 10:18 pm    Post subject:
Reply with quote

Rafael,

Here's a DFSORT job that will actually do what you asked for:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=Dsn.SORT1,DISP=SHR
//OUT1 DD DSN=Dsn.SORT2,DISP=OLD
//OUT2 DD DSN=Dsn.SORT3,DISP=OLD
//SYSIN    DD    *
  OPTION COPY
  OUTFIL FNAMES=OUT1,BUILD=(1,3,80:X)
  OUTFIL FNAMES=OUT2,BUILD=(5,3,80:X)
/*


Since you are using DFSORT, you should post in the DFSORT Forum. I'm moving this thread there.
Back to top
View user's profile Send private message
rafael2009

New User


Joined: 21 May 2009
Posts: 18
Location: Mumbai

PostPosted: Thu Jun 04, 2009 1:46 pm    Post subject:
Reply with quote

Thank you Frank...
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 High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am


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