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

Help wanted on sort cards


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

New User


Joined: 27 Jul 2006
Posts: 5
Location: chennai

PostPosted: Wed Apr 16, 2008 3:44 pm
Reply with quote

I have one input file, need to split it into two output files which can be done. problem i am facing in this is...for the first file say city code = 0, in need to do outrec to change the length and in the second file i need to write the records other than city code 0.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Wed Apr 16, 2008 3:51 pm
Reply with quote

Title of your thread changed - please use a meaningful title

OK - Input LRECL is what, input RECFM is what, output file 1 RECFM & LRECL are what, same for output file 2.

Why do you need to change the length, or are you reformatting the output file 1 ?

Give examples of both input and expected outputs.
Back to top
View user's profile Send private message
dhivakarram

New User


Joined: 27 Jul 2006
Posts: 5
Location: chennai

PostPosted: Wed Apr 16, 2008 4:02 pm
Reply with quote

input file and ouput file record length is 504 VB.

i am able to create one sortout file by using this sort card.

SORT FIELDS=COPY
INCLUDE COND=(5,2,CH,EQ,X'0004')
OUTREC OVERLAY=(14:C'XXXX XXXX XXXX XXXX',60:C'99999999',
74:C'99999999')  

now need to include one more conditon for city code = 0. then only it should do outrec and write this format to the sortout1 file. if city code is not equal to 0, should write the whole record into sortout2
Back to top
View user's profile Send private message
shrivatsa
Warnings : 1

Active User


Joined: 17 Mar 2006
Posts: 174
Location: Bangalore

PostPosted: Wed Apr 16, 2008 5:20 pm
Reply with quote

Why don't you use two OUTFIL statements, e.g.

Code:
 
  OUTFIL FNAMES=SORTOUT1,INCLUDE=(5,2,CH,EQ,X'0004')
  OUTFIL FNAMES=SORTOUT2,INCLUDE=(5,2,CH,NE,X'0004')
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 Apr 16, 2008 10:28 pm
Reply with quote

dhivakarram,

I think you want DFSORT control statements something like this. I assumed your city code was 1 byte in position 11 - change as needed

Code:

    SORT FIELDS=COPY
    INCLUDE COND=(5,2,CH,EQ,X'0004')
    OUTFIL FNAMES=SORTOUT1,INCLUDE=(11,1,CH,EQ,C'0'),
      OVERLAY=(14:C'XXXX XXXX XXXX XXXX',60:C'99999999',
           74:C'99999999')   
    OUTFIL FNAMES=SORTOUT2,SAVE


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:

Use [URL] BBCode for External Links
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