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
 

 

Syncsort Format delimited records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort Format delimited records
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    Post subject:
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

Site Director


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

PostPosted: Fri Mar 26, 2010 10:18 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon Mar 29, 2010 12:27 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon Mar 29, 2010 7:29 pm    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Tue Mar 30, 2010 4:20 pm    Post subject:
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    Post subject:
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: 25
Location: Mumbai

PostPosted: Tue Mar 30, 2010 4:53 pm    Post subject: Reply to: Syncsort Format delimited records
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: 1703
Location: Australia

PostPosted: Wed Mar 31, 2010 2:43 am    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Wed Mar 31, 2010 5:57 am    Post subject:
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Wed Mar 31, 2010 7:20 pm    Post subject:
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    Post subject:
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: 500
Location: USA

PostPosted: Thu Apr 01, 2010 9:30 pm    Post subject:
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    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 syncsort: copy lines after the keyword shreya19 SYNCSORT 1 Fri Dec 02, 2016 9:47 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am


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