MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Squeeze using Syncsort

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Martin
Beginner


Joined: 20 Mar 2006
Posts: 133
Topics: 58

PostPosted: Wed Feb 21, 2007 12:30 pm    Post subject: Squeeze using Syncsort Reply with quote

Hi,

I need a solution for the below problem using SYNCSORT. We do not have DFSORT in our shop.

Input file

Code:

11111  2006/02/01  abc  paper   xyz    january
11112  2006/01/01  abd  paper   xyz    February
11113   2006/01/01    abe     paper      xyz       March
11114   2006/03/01    abf     paper      xyz       March


As you can see rec 3 and 4 are shifted right .. I need to remove the extra spaces and output should look like

Code:

11111  2006/02/01  abc  paper   xyz    january
11112  2006/01/01  abd  paper   xyz    February
11113  2006/01/01  abe  paper   xyz    March
11114  2006/03/01  abf  paper   xyz    March


file is FB file and the length is 289

-Mt
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Feb 21, 2007 1:15 pm    Post subject: Reply with quote

I know you said you don't have DFSORT, but for those who do, I thought I'd show how to do this with DFSORT.

If you want 2 blanks between each field, you can use this DFSORT job:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/289)
//SORTOUT DD DSN=...  output file (FB/289)
//SYSIN    DD    *
  OPTION COPY
  INREC OVERLAY=(1,289,SQZ=(SHIFT=LEFT,MID=C'  '))
/*


If you want different numbers of blanks between fields as shown in your example, you can use this DFSORT job:

Code:

//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/289)
//SORTOUT DD DSN=...  output file (FB/289)
//SYSIN    DD    *
  OPTION COPY
  INREC PARSE=(%01=(ENDBEFR=BLANKS,FIXLEN=7),
               %02=(ENDBEFR=BLANKS,FIXLEN=12),
               %03=(ENDBEFR=BLANKS,FIXLEN=5),
               %04=(ENDBEFR=BLANKS,FIXLEN=8),
               %05=(ENDBEFR=BLANKS,FIXLEN=7),
               %06=(FIXLEN=8)),
   BUILD=(%01,%02,%03,%04,%05,%06,289:X)
/*


For complete information on DFSORT's SQZ and PARSE functions, see:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Martin
Beginner


Joined: 20 Mar 2006
Posts: 133
Topics: 58

PostPosted: Wed Feb 21, 2007 1:21 pm    Post subject: Reply with quote

Any Solutions using SYNCSORT?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Feb 21, 2007 1:45 pm    Post subject: Reply with quote

Martin,

Run the following job and post the first line in your sysout which tells us the version of syncsort you have
Code:

//STEP0100 EXEC PGM=SORT 
//SYSOUT   DD SYSOUT=*   
//SORTIN   DD *           
//SORTOUT  DD SYSOUT=*   
//SYSIN    DD *           
  SORT FIELDS=COPY       
/*   


Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Martin
Beginner


Joined: 20 Mar 2006
Posts: 133
Topics: 58

PostPosted: Fri Feb 23, 2007 12:45 pm    Post subject: Reply with quote

kolusu,

Below is the detail:

SYNCSORT FOR Z/OS 1.2.1.1R U.S. PATENTS: 4210961, 5117495 (C)
z/OS 1.6.0
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Feb 23, 2007 12:51 pm    Post subject: Reply with quote

martin,

try this


Code:

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                           
11111  2006/02/01  ABC  PAPER   XYZ    JANUARY             
11112  2006/01/01  ABD  PAPER   XYZ    FEBRUARY           
11113   2006/01/01    ABE     PAPER      XYZ       MARCH   
11114   2006/03/01    ABF     PAPER      XYZ       MARCH   
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                         
  INREC IFTHEN=(WHEN=(8,1,CH,EQ,C' ',AND,9,1,CH,GT,C' '), 
       OVERLAY=(08:09,72),HIT=NEXT),                       
        IFTHEN=(WHEN=(20,1,CH,EQ,C' ',AND,21,1,CH,GT,C' '),
       OVERLAY=(20:21,60),HIT=NEXT),                       
        IFTHEN=(WHEN=(20,2,CH,EQ,C' ',AND,22,1,CH,GT,C' '),
       OVERLAY=(20:22,59),HIT=NEXT),                       
        IFTHEN=(WHEN=(25,1,CH,EQ,C' ',AND,26,1,CH,GT,C' '),
       OVERLAY=(25:26,54),HIT=NEXT),                       
        IFTHEN=(WHEN=(25,2,CH,EQ,C' ',AND,27,1,CH,GT,C' '),
       OVERLAY=(25:27,53),HIT=NEXT),                       
        IFTHEN=(WHEN=(25,3,CH,EQ,C' ',AND,28,1,CH,GT,C' '),
       OVERLAY=(25:28,52),HIT=NEXT),                       
        IFTHEN=(WHEN=(33,1,CH,EQ,C' ',AND,34,1,CH,GT,C' '),
       OVERLAY=(33:34,46),HIT=NEXT),                       
        IFTHEN=(WHEN=(33,2,CH,EQ,C' ',AND,35,1,CH,GT,C' '),
       OVERLAY=(33:35,45),HIT=NEXT),                       
        IFTHEN=(WHEN=(33,3,CH,EQ,C' ',AND,36,1,CH,GT,C' '),
       OVERLAY=(33:36,44),HIT=NEXT),                       
        IFTHEN=(WHEN=(40,1,CH,EQ,C' ',AND,41,1,CH,GT,C' '),
       OVERLAY=(40:41,39),HIT=NEXT),                       
        IFTHEN=(WHEN=(40,2,CH,EQ,C' ',AND,42,1,CH,GT,C' '),
       OVERLAY=(40:42,38),HIT=NEXT),                       
        IFTHEN=(WHEN=(40,3,CH,EQ,C' ',AND,43,1,CH,GT,C' '),
       OVERLAY=(40:43,37))                       
/*                                                         


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Martin
Beginner


Joined: 20 Mar 2006
Posts: 133
Topics: 58

PostPosted: Fri Feb 23, 2007 1:08 pm    Post subject: Reply with quote

Thanks a lot Kolusu !!

This just shows that MVSforums is a one stop solution to all mainframe problems/issue..

Thanks once again!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group