Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Syncsort - Sorting the file Based on the Record Layout

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort - Sorting the file Based on the Record Layout
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: 500
Location: USA

PostPosted: Tue Mar 24, 2009 7:43 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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: 2285
Location: @my desk

PostPosted: Wed Mar 25, 2009 11:22 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us