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

Syncsort Format delimited records


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

New User


Joined: 08 Jun 2009
Posts: 36
Location: Bangalore

PostPosted: Fri Mar 26, 2010 7:46 pm
Reply with quote

Hi,

Here are the input records:

Code:
****** ***************************** Top of Data ******
000100 123456|JOHN|MATHEWS|18-03-2010                 
000200 846273|CHRISTOPHER|FERNANDES|20-08-2007         
000300 309881|MARAGARETTE|D'SOUZA|             


Layout of input record
First field - Fixed-length (say employee no.)
Delimiter
Second field - Variable length (first name)
Delimitr
Third field - Variable length (last name)
Delimiter
Fourth field - fixed length - date updated

Intended output:
Col Length Field
1-6 - 6 - Employee No.
7-31 - 25 - First Name
32-56 -25- Last Name
57-66 -10- Date

I need to achieve this using SYNCSORT.
Back to top
View user's profile Send private message
Bala1

New User


Joined: 18 Mar 2010
Posts: 6
Location: london

PostPosted: Fri Mar 26, 2010 9:28 pm
Reply with quote

Hi Vivek,
Try using the ICEMAN utility
sample cards would be as follows..
******************************************************
//SYMNAMES DD *
Fld1,1,6
Fld2,%00
Fld3,%01
Fld4,%02
Pipe,'|'
Blank,' '
//SYSIN DD *
OPTION COPY
INREC PARSE=(Fld2=(ABSPOS=8,FIXLEN=25,ENDBEFR=Pipe),
Fld3=(FIXLEN=25,ENDBEFR=Pipe),
Fld4=(FIXLEN=25,ENDBEFR=Blank)),
BUILD=(Fld1,Pipe,Fld2,Pipe,
Fld3,Pipe,Fld4)
/*

Hope this helps you.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Mar 26, 2010 10:18 pm
Reply with quote

Hello,

Bala - please post the informational output generated when you ran this on your system.
Back to top
View user's profile Send private message
viveksurya

New User


Joined: 08 Jun 2009
Posts: 36
Location: Bangalore

PostPosted: Mon Mar 29, 2010 12:10 pm
Reply with quote

Hi Bala,

I am getting the following error message:

Code:
*** ERRORS IN SYMNAMES STATEMENTS ***         
FLD2,%00                                       
     *                                         
*** SYNTAX ERROR ***                           
FLD3,%01                                       
     *                                         
*** SYNTAX ERROR ***                           
FLD4,%02                                       
     *                                         
*** SYNTAX ERROR ***                           
WER470A  SYMNAMES ERRORS FOUND                 
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000 
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE 


I am not sure whether this will work for SYNCSORT. I am using version (SYNCSORT FOR Z/OS 1.2.3.1R ).
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Mar 29, 2010 12:27 pm
Reply with quote

Hello,

Please post the complete step including the jcl and control statements.
Back to top
View user's profile Send private message
viveksurya

New User


Joined: 08 Jun 2009
Posts: 36
Location: Bangalore

PostPosted: Mon Mar 29, 2010 2:47 pm
Reply with quote

Here is step & conrtol cards:

Code:
//SORTIN   DD *                                               
123456|JOHN|MATHEWS|18-03-2010                                 
846273|CHRISTOPHER|FERNANDES|20-08-2007                       
309881|MARAGARETTE|D'SOUZA|11-09-2001                         
//SORTOUT DD  DSN=VS059U.FILE.OUTPIPE,DISP=(NEW,CATLG,DELETE),
//            DCB=(RECFM=FB,LRECL=80),                         
//            SPACE=(TRK,(2,12),RLSE)                         
//SYMNAMES DD *                                               
FLD1,1,6                                                       
FLD2,%00                                                       
FLD3,%01                                                       
FLD4,%02                                                       
PIPE,'|'                                                       
BLANK,' '                                                     
//SYMNOUT  DD SYSOUT=* 
//SYSIN DD *                                         
OPTION COPY                                         
INREC PARSE=(FLD2=(ABSPOS=8,FIXLEN=25,ENDBEFR=PIPE),
FLD3=(FIXLEN=25,ENDBEFR=PIPE),                       
FLD4=(FIXLEN=10,ENDBEFR=BLANK)),                     
BUILD=(FLD1,PIPE,FLD2,PIPE,FLD3,PIPE,FLD4)         
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Mar 29, 2010 7:29 pm
Reply with quote

Hello,

Suggest you try putting those values in quotes (i.e. FLD2,'%00' ). This isn't tested as i don't have the current release of the product available. . .
Back to top
View user's profile Send private message
viveksurya

New User


Joined: 08 Jun 2009
Posts: 36
Location: Bangalore

PostPosted: Tue Mar 30, 2010 4:17 pm
Reply with quote

Hi Dick,

That ,somehow, doesnt seem to work. IT is considering it as Character.

Sort/Control Card:

Code:
//SYMNAMES DD *                                       
 FLD1,1,6                                             
 FLD2,'%00'                                           
 FLD3,'%01'                                           
 FLD4,'%02'                                           
 PIPE,'|'                                             
 BLANK,' '                                           
//SYMNOUT  DD SYSOUT=*                               
//SYSIN    DD *                                       
OPTION COPY                                           
INREC PARSE=(FLD2=(ABSPOS=8,FIXLEN=25,ENDBEFR=PIPE), 
             FLD3=(FIXLEN=25,ENDBEFR=PIPE),           
             FLD4=(FIXLEN=10,ENDBEFR=BLANK)),         
BUILD=(FLD1,PIPE,FLD2,PIPE,FLD3,PIPE,FLD4)           



SYMNOUT:

Code:
****** SYMNAMES SYMBOL STATEMENTS ******   
 FLD1,1,6                                 
 FLD2,'%00'                               
 FLD3,'%01'                               
 FLD4,'%02'                               
 PIPE,'|'                                 
 BLANK,' '                                 
********** SYMBOL DEFINITIONS **********   
FLD1,1,6                                   
FLD2,C'%00'                               
FLD3,C'%01'                               
FLD4,C'%02'                               
PIPE,C'|'                                 
BLANK,C' '     


SYSOUT:

Code:
SYSIN :                                             
OPTION COPY                                         
       *                                           
INREC PARSE=(FLD2=(ABSPOS=8,FIXLEN=25,ENDBEFR=PIPE),
      *                                             
             FLD3=(FIXLEN=25,ENDBEFR=PIPE),         
             *                                     
             FLD4=(FIXLEN=10,ENDBEFR=BLANK)),       
             *                                     
BUILD=(FLD1,PIPE,FLD2,PIPE,FLD3,PIPE,FLD4)         
WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT     
WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT     
WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT     
WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT     
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000       
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Mar 30, 2010 4:20 pm
Reply with quote

Hi,

start your SYSIN parameters in col 2.


Gerry
Back to top
View user's profile Send private message
viveksurya

New User


Joined: 08 Jun 2009
Posts: 36
Location: Bangalore

PostPosted: Tue Mar 30, 2010 4:52 pm
Reply with quote

Hi Gerry,

NO luck after pushing SYSIN parameters to col 2. Same error..!!
Back to top
View user's profile Send private message
Uday Kumar R

New User


Joined: 07 Nov 2007
Posts: 27
Location: Mumbai

PostPosted: Tue Mar 30, 2010 4:53 pm
Reply with quote

Hello,
I am not much aware about the syncsort, but the below code help you out if we use sort card. I changed the PGM=SORT to PGM=SYNCSORT and it provided the same result. Please check.

Code:

//STEP030  EXEC PGM=SORT                     
//SORTIN   DD  *                             
123456|MATSON|BARABARA|18-03-2010           
876542|CASSENDRA|FULLER|12-04-2009           
345623|DENNIS|FERNANDES|                     
//SORTOUT  DD SYSOUT=*                       
//SYSOUT   DD SYSOUT=*                       
//SYSIN    DD *                             
 SORT FIELDS=COPY                           
 OUTREC PARSE=(%01=(ENDBEFR=C'|',FIXLEN=06),
               %02=(ENDBEFR=C'|',FIXLEN=25),
               %03=(ENDBEFR=C'|',FIXLEN=25),
               %04=(ENDBEFR=C'|',FIXLEN=10)),
     BUILD=(%01,%02,%03,%04)                 
/*                                           
//                                           


Out Put:

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8-
********************************* TOP OF DATA**********************************
123456MATSON                   BARABARA                 18-03-2010
876542CASSENDRA                FULLER                   12-04-2009
345623DENNIS                   FERNANDES
******************************** BOTTOM OF DATA**********************************


Regards,
Uday
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Mar 31, 2010 2:43 am
Reply with quote

Hi Viveksurya,

can you please show the entire job output.


Gerry
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Mar 31, 2010 5:57 am
Reply with quote

viveksurya wrote:
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
Quote:
NO luck after pushing SYSIN parameters to col 2. Same error..!!
gcicchet wrote:
can you please show the entire job output.
Like Gerry asked and my signiture asks:
CICS Guy wrote:
Post the jcl, control statements and all messages (including the message ids) created by the job you are inquiring about.
Back to top
View user's profile Send private message
viveksurya

New User


Joined: 08 Jun 2009
Posts: 36
Location: Bangalore

PostPosted: Wed Mar 31, 2010 5:27 pm
Reply with quote

Hi Uday,

I tried your sort-card too.

Sortcard:

Code:
//SORTIN   DD *                                               
123456|JOHN|MATHEWS|18-03-2010                                 
846273|CHRISTOPHER|FERNANDES|20-08-2007                       
309881|MARAGARETTE|D'SOUZA|11-09-2001                         
//SORTOUT DD  DSN=VS059U.FILE.OUTPIPE,DISP=(NEW,CATLG,DELETE),
//            DCB=(RECFM=FB,LRECL=80),                         
//            SPACE=(TRK,(2,12),RLSE)                         
//SYSIN    DD *                                               
  SORT FIELDS=COPY                                             
  OUTREC PARSE=(%01=(ENDBEFR=C'|',FIXLEN=06),                 
                %02=(ENDBEFR=C'|',FIXLEN=25),                 
                %03=(ENDBEFR=C'|',FIXLEN=25),                 
                %04=(ENDBEFR=C'|',FIXLEN=10)),                 
  BUILD=(%01,%02,%03,%04)                                     
/*


SYSOUT:

Code:
SYNCSORT FOR Z/OS  1.2.3.1R    U.S. PATENTS: 4210961, 5117495   (C) 2005 SYNCSO
                                                      z/OS   1.9.0             
PRODUCT LICENSED FOR CPU SERIAL NUMBER 53B6C, MODEL 2086 460              LICEN
SYSIN :                                                                       
  SORT FIELDS=COPY                                                             
  OUTREC PARSE=(%01=(ENDBEFR=C'|',FIXLEN=06),                                 
         *                                                                     
                %02=(ENDBEFR=C'|',FIXLEN=25),                                 
                %03=(ENDBEFR=C'|',FIXLEN=25),                                 
                %04=(ENDBEFR=C'|',FIXLEN=10)),                                 
  BUILD=(%01,%02,%03,%04)                                                     
WER268A  OUTREC STATEMENT  : SYNTAX ERROR                                     
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                                 


I browsed across various posts and found out that PARSE requires SYNCSORT 1.3. while I am having 1.2.3 version.

Hi Gerry/CICs Guy,

Your thought on version issue..??
Back to top
View user's profile Send private message
viveksurya

New User


Joined: 08 Jun 2009
Posts: 36
Location: Bangalore

PostPosted: Wed Mar 31, 2010 5:31 pm
Reply with quote

Hi Gerry/CICs Guy,

Here is the JCL which I used earlier,

Code:
000001 //PIPEREC JOB (SAARTP,0000,BN44),'VIVEKSURYA',CLASS=3,                 
000002 //         MSGCLASS=T,MSGLEVEL=(1,1),REGION=0M,NOTIFY=&SYSUID           
000003 /*ROUTE  PRINT LOCAL                                                   
000004 /*JOBPARM S=KC00                                                       
000005 //*********************************************************************
000006 //* TO ADD GIVEN NUMBERS AND GET THE SUM IN THE OUTPUT                **
000007 //*********************************************************************
000008 //STEP0010 EXEC PGM=SYNCSORT,COND=(0,NE),REGION=4096K                   
000009 //STEPLIB  DD DSN=SAART.TEST.LOADLIB,DISP=SHR                           
000010 //SYSPRINT DD SYSOUT=*                                                 
000011 //SYSOUT   DD SYSOUT=*                                                 
000012 //SYSABOUT DD SYSOUT=*                                                 
000013 //SYSDBOUT DD SYSOUT=*                                                 
000014 //SYSUDUMP DD SYSOUT=*                                                 
000015 //SYMNAMES DD *                                                         
000016  FLD1,1,6                                                               
000017  FLD2,'%00'                                             
000018  FLD3,'%01'                                             
000019  FLD4,'%02'                                             
000020  PIPE,'|'                                               
000021  BLANK,' '                                             
000022 //SYMNOUT  DD SYSOUT=*                                 
000023 //SYSIN    DD *                                         
000024 OPTION COPY                                             
000025 INREC PARSE=(FLD2=(ABSPOS=8,FIXLEN=25,ENDBEFR=PIPE),   
000026              FLD3=(FIXLEN=25,ENDBEFR=PIPE),             
000027              FLD4=(FIXLEN=10,ENDBEFR=BLANK)),           
000028 BUILD=(FLD1,PIPE,FLD2,PIPE,FLD3,PIPE,FLD4)             
000029 //SORTIN   DD *                                         
000030 123456|JOHN|MATHEWS|18-03-2010                         
000031 846273|CHRISTOPHER|FERNANDES|20-08-2007                 
000032 309881|MARAGARETTE|D'SOUZA|11-09-2001                   
000033 //SORTOUT DD  DSN=VS059U.FILE.OUTPIPE,DISP=(NEW,CATLG,DELETE),   
000034 //            DCB=(RECFM=FB,LRECL=80),                           
000035 //            SPACE=(TRK,(2,12),RLSE)                             
000036 /*                                                               


& here is the output:
SYSOUT:
Code:
 SYNCSORT FOR Z/OS  1.2.3.1R    U.S. PATENTS: 4210961, 5117495   (C) 2005 SYNCSO
                                                       z/OS   1.9.0             
 PRODUCT LICENSED FOR CPU SERIAL NUMBER 53B6C, MODEL 2086 460              LICEN
 SYSIN :                                                                       
 OPTION COPY                                                                   
        *                                                                       
 INREC PARSE=(FLD2=(ABSPOS=8,FIXLEN=25,ENDBEFR=PIPE),                           
       *                                                                       
              FLD3=(FIXLEN=25,ENDBEFR=PIPE),                                   
              *                                                                 
              FLD4=(FIXLEN=10,ENDBEFR=BLANK)),                                 
              *                                                                 
 BUILD=(FLD1,PIPE,FLD2,PIPE,FLD3,PIPE,FLD4)                                     
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT                               
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT                               
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT                               
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT                               
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 
 WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE   


SYMNOUT:
Code:
 ****** SYMNAMES SYMBOL STATEMENTS ******       
  FLD1,1,6                                     
  FLD2,'%00'                                   
  FLD3,'%01'                                   
  FLD4,'%02'                                   
  PIPE,'|'                                     
  BLANK,' '                                     
 ********** SYMBOL DEFINITIONS **********       
 FLD1,1,6                                       
 FLD2,C'%00'                                   
 FLD3,C'%01'                                   
 FLD4,C'%02'                                   
 PIPE,C'|'                                     
 BLANK,C' '                                     
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Mar 31, 2010 7:20 pm
Reply with quote

Hello,

The release of Syncsort is older than the PARSE feature. In the 1.2 documentation, i also do not see OPTION COPY (but you can use SORT FIELDS=COPY).
Back to top
View user's profile Send private message
viveksurya

New User


Joined: 08 Jun 2009
Posts: 36
Location: Bangalore

PostPosted: Wed Mar 31, 2010 7:49 pm
Reply with quote

Thanks Dick..

Bad news for me... I doubted about the version issue but was holding hope assuming that there would be some way out through SYNCSORT.
The only other way I see to achieve this is through 'UNSTRING' in COBOL.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Thu Apr 01, 2010 9:30 pm
Reply with quote

dick scherrer wrote:
Hello,

The release of Syncsort is older than the PARSE feature. In the 1.2 documentation, i also do not see OPTION COPY (but you can use SORT FIELDS=COPY).

Just to clarify, PARSE support was included in SyncSort for z/OS 1.3, and SyncSort does contain compatibility support for OPTION COPY.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 0
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top