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
 

 

Sorting a file with different structure

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

New User


Joined: 12 Dec 2010
Posts: 3
Location: Hyderabad

PostPosted: Thu Dec 23, 2010 8:19 pm    Post subject: Sorting a file with different structure
Reply with quote

hi,

Is it possible to sort a file with a index such that in one half of the file index is at different position and for other half index is at different position.

eg.

POSITION (1-3)____ (4-6)________ (9-11)
_________SIS ______111
_________SIS ______222
_________SIS ______333
_________DCU __________________ 444
_________DCU __________________ 555
_________DCU __________________ 666


For first half position 4-6 is index and for other half position 9-11 is index.
Is it possible for DFSORT to take index as 4-6 for first part and 9-11 for other part.
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: Fri Dec 24, 2010 5:41 am    Post subject:
Reply with quote

Yes, you can, but you haven't given enough information for me to show you how.

How do you identify the "first part" and "second part"? Do records with 'SIS' in 1-3 have the key in 4-6, and records with 'DCU' in 1-3 have the key in 9-11? Or is it something else that identifies where the key is in a particular record? What?

Also, what is the RECFM and LRECL of your input file?
Back to top
View user's profile Send private message
neerajsaran

New User


Joined: 12 Dec 2010
Posts: 3
Location: Hyderabad

PostPosted: Fri Dec 24, 2010 11:22 am    Post subject:
Reply with quote

Yes it is the same way, for the record SIS in 1-3, key is in 4-6 and for record DCU in 1-3, key is in 9-11.

RECFM = FB
LRECL = 1713
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: Fri Dec 24, 2010 11:24 pm    Post subject:
Reply with quote

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

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (FB/1713)
//SORTOUT DD DSN=...  output file (FB/1713)
//SYSIN DD *
  INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'SIS'),OVERLAY=(1714:4,3)),
   IFTHEN=(WHEN=(1,3,CH,EQ,C'DCU'),OVERLAY=(1714:9,3))
  SORT FIELDS=(1714,3,CH,A)
  OUTREC BUILD=(1,1713)
/*
Back to top
View user's profile Send private message
neerajsaran

New User


Joined: 12 Dec 2010
Posts: 3
Location: Hyderabad

PostPosted: Mon Jan 03, 2011 3:13 pm    Post subject:
Reply with quote

hi,
thnks a lot.
It worked exactly the way i wished..
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 Sorting group data rajella DFSORT/ICETOOL 4 Sun Jan 22, 2017 11:32 pm
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 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


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