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

Syncsort - Sorting the file Based on the Record Layout


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ashwinreddy

Active User


Joined: 16 Sep 2004
Posts: 106
Location: Hyderabad

PostPosted: Tue Mar 24, 2009 12:18 pm
Reply with quote

Hi All,

I need to Sort a file Which have 3 layouts (identified by first 2 positions), as below

01 6030749050008008AVILA, EDUARDO GREENTEC LANDSC
02 60307490500080080011FDWF36L64EC694602004FORD
02 60307490500080080021FDWF36114ED485522004FORD
02 60307490500080080031FDWF36114ED483332005FORD
03 6030749050008008COMM VEH DRIVER

Currently these are Sorted as SORT FIELDS=(3,23,CH,A,1,2,CH,A)

Basically i need to Sort these records based on record types, as when 01 or 03 then above sort should work and when 02 it should above sort plus 3 positions Highlighted.

To be more specific,

when first 2 positions = 01, 03 then sort as =(3,23,CH,A,1,2,CH,A)
when first 2 positions = 02 then sort as (3,23,CH,A,1,2,CH,A) & 3 positions.

Limitations:

1) Should be used only in Sort, can be easily done in program but client is not convinced.
2) we use SYNCSORT in out region.

am a beginner in SYNCSORT, so not aware of the advanced commands in Sort.

Please Advice me some Solution/Suggestion's for this specific requirement.

Thanks for the Help in Advance.

Cheers
Ashwin
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Tue Mar 24, 2009 7:43 pm
Reply with quote

Hello Ashwin,

What are the other 3 fields you want sorted when the first 2 positions = 02?
Back to top
View user's profile Send private message
Maccobin

New User


Joined: 03 Nov 2006
Posts: 1
Location: China

PostPosted: Wed Mar 25, 2009 4:06 pm
Reply with quote

If i get you correctly, u want to sort a file on the basis of the contents of the file. What you can do is - Split the file into two on the basis of first two letter using SORT utility and then sort each files as per how you want it to be.
Back to top
View user's profile Send private message
genesis786

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Wed Mar 25, 2009 4:50 pm
Reply with quote

can you use SYNCTOOL instead of SYNCSORT ?
Back to top
View user's profile Send private message
genesis786

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Wed Mar 25, 2009 4:59 pm
Reply with quote

if i understoodd correctly.. i tried the following using SYNCTOOL..

Code:

//S1    EXEC  PGM=SYNCTOOL                                   
//TOOLMSG   DD  SYSOUT=*                                     
//DFSMSG    DD  SYSOUT=*                                     
//IN DD *                                                     
02 60307490500080080021FDWF36114ED485522004FORD               
02 60307490500080080011FDWF36L64EC694602004FORD               
03 6030749050008008COMM VEH DRIVER                           
02 60307490500080080031FDWF36114ED483332005FORD               
01 6030749050008008AVILA, EDUARDO GREENTEC LANDSC             
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(1,1)),DISP=(MOD,PASS)
//OUT DD SYSOUT=*                                             
//TOOLIN  DD    *                                             
SORT FROM(IN) TO(T1) USING(CTL1)                             
SORT FROM(IN) TO(T1) USING(CTL2)                             
SORT FROM(T1) TO(OUT) USING(CTL3)                             
/*                                                           
//CTL1CNTL DD *                                               
  SORT FIELDS=(4,16,CH,A,1,2,CH,A)           
  INCLUDE COND=(1,2,SS,EQ,C'01 03')           
/*                                           
//CTL2CNTL DD *                               
  SORT FIELDS=(4,16,CH,A,1,2,CH,A,20,3,CH,A) 
  INCLUDE COND=(1,2,CH,EQ,C'02')             
/*                                           
//CTL3CNTL DD *                               
  SORT FIELDS=(1,2,CH,A)                     
/*                                           
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Wed Mar 25, 2009 11:22 pm
Reply with quote

Quote:
when first 2 positions = 02 then sort as (3,23,CH,A,1,2,CH,A) & 3 positions
ashwinreddy,

For '02' records, the sort positions which you mentioned are not clear and even they overlap. The highlighted 3 characters in your sample data are already part of 3,23,CH. And you dont need to sort the first 2 positions here as it can have only one value viz. '02'
Back to top
View user's profile Send private message
ashwinreddy

Active User


Joined: 16 Sep 2004
Posts: 106
Location: Hyderabad

PostPosted: Sun Apr 12, 2009 8:17 pm
Reply with quote

Hi All,

Sorry that was my typo mistake, actually 02 Records should be as

(3,16,CH,A,1,2,CH,A) and the Highlighted 3 positions.

I will try for the above solution suggestion.

Thanks all for you time.

Cheers
Ashwin
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top