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

sort outrec fields


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

New User


Joined: 22 Sep 2008
Posts: 49
Location: Chennai,Tamilnadu

PostPosted: Tue Mar 22, 2011 3:46 pm
Reply with quote

I want to format such that my output file contains from 23rd character of input file. In my case I will not be knowing the input file length. I am giving a fixed length of 5000 to my output file. I am getting syntax error as I am not giving the length. I want everything from 23rd character from input file. How can we do it in sort ?

Code:


SORT     FIELDS=COPY
OUTREC FIELDS=(1:23,)
                                 $
ICE007A E SYNTAX ERROR


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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Mar 22, 2011 5:56 pm
Reply with quote

Input file is FB / VB
The LRECL of the input file is ..........
Back to top
View user's profile Send private message
lokeshwar_manoharan

New User


Joined: 22 Sep 2008
Posts: 49
Location: Chennai,Tamilnadu

PostPosted: Tue Mar 22, 2011 7:02 pm
Reply with quote

Input file is FB and LRECL is 5000
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Tue Mar 22, 2011 7:15 pm
Reply with quote

lokeshwar_manoharan wrote:
In my case I will not be knowing the input file length.

lokeshwar_manoharan wrote:
Input file is FB and LRECL is 5000


Conflicting statements. Which is it?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Mar 22, 2011 7:38 pm
Reply with quote

If the input file is FB with LRECL 5000, and you want to lose the first 22 bytes from the copied version of the file, then how many bytes will you actually copy, and therefor be able to accurately calculate the LRECL of the output file.
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: Tue Mar 22, 2011 11:38 pm
Reply with quote

lokeshwar_manoharan,

The correct syntax for the OUTREC statement you're trying to use is:

Code:

  OUTREC FIELDS=(1:23,m)


YOU have to replace m with the length of the input field you want.

If your input file has RECFM=FB and LRECL=5000, and you want to copy from position 23 to the end of the input record, the OUTREC statement would be:

Code:

  OUTREC FIELDS=(1:23,4978)


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:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080
Back to top
View user's profile Send private message
lokeshwar_manoharan

New User


Joined: 22 Sep 2008
Posts: 49
Location: Chennai,Tamilnadu

PostPosted: Fri Mar 25, 2011 12:50 pm
Reply with quote

Thanks Frank
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top