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

Syncsort - sort, ZD to PD, sum PD, PD to ZD, Build output


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

New User


Joined: 04 Feb 2009
Posts: 8
Location: Scotland

PostPosted: Fri Feb 13, 2009 4:29 pm
Reply with quote

Hi everyone this is my first posting.

I am using Syncsort and attempting to process a file as follows:
1) Sort fields.
2) Convert ZD to PD; example of ZD formats are '000000000002.459000-' and '0000000000000005.42-'.
3) Sum new PD fields.
4) Convert PD back to ZD.
5) Create output record with fewer fields.

My approach has to be execute a statement check the results then add the next statement.

After step 4) the sign is missing.
I get syntax errors for step 5).

Here are the statements:
Code:
SORT FIELDS=(1,4,CH,A, 
             5,3,CH,A,   
             8,2,CH,A,   
             10,1,CH,A, 
             11,3,CH,A, 
             14,2,CH,A, 
             16,5,CH,A, 
             21,22,CH,A,
             43,10,CH,A,
             95,10,CH,A,
             53,2,CH,A,                 
             55,19,ZD,A 
             75,19,ZD,A
             132,8,CH,A)
                                                       
INREC OVERLAY=(55:55,20,SFF,TO=PD,LENGTH=9,10X,
75:75,20,SFF,TO=PD,LENGTH=9,10X)     

SUM FIELDS=(55,9,PD,75,9,PD)           
                                                       
OUTREC FIELDS=(1,54,                                   
              (55:55,9,PD,                             
               EDIT=(TTTTTTTTTTTT.TTTTTTS),SIGNS=(+,-),
               75:75,9,PD,                             
               EDIT=(TTTTTTTTTTTTTTTT.TTS),SIGNS=(+,-),


Can you help?

P.S. Apologies if I have unintentionally broken any rules. Please keep me right.

Regards,
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Feb 13, 2009 5:04 pm
Reply with quote

Eddie Wilson wrote:
I get syntax errors
Please post your sysouts including the syntax errors.....
Back to top
View user's profile Send private message
Eddie Wilson

New User


Joined: 04 Feb 2009
Posts: 8
Location: Scotland

PostPosted: Fri Feb 13, 2009 5:21 pm
Reply with quote

Here are the syntax error statements:
WER268A SORT STATEMENT : SYNTAX ERROR
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER268A OUTREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Feb 13, 2009 9:05 pm
Reply with quote

Eddie Wilson,

Can you post here your SYSOUT messages using "Code" tags.
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 Feb 13, 2009 10:56 pm
Reply with quote

Hello Eddie and welcome to the forum,

Quote:
example of ZD formats are '000000000002.459000-' and '0000000000000005.42-'.
FWIW- Those are not ZD values. . . As you coded later, SFF should work depending on your release of Syncsort.

As Arun requested, please post the SYSOUT using the "Code" tags.
Back to top
View user's profile Send private message
Eddie Wilson

New User


Joined: 04 Feb 2009
Posts: 8
Location: Scotland

PostPosted: Fri Feb 13, 2009 11:18 pm
Reply with quote

I don't know what "Code" tags are. Obviously I have a lot of catching up to do!

Regards,
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Feb 13, 2009 11:26 pm
Reply with quote

Eddie Wilson,

No issues. To preserve the alignment of code and for better readability, you can wrap around your text with Code tags using the "Code" button provided here.
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: Sat Feb 14, 2009 1:33 am
Reply with quote

Hello Eddie,

If you look at your original post, you will see that your sort control info has been "Code"ed.

The best way to post info from a mainframe screen is to use copy/paste and the Code tag. There is a Preview function that will let you see your post as it will appear to the forum rather than how it appears in the Reply Editor. When copying 3270 data, do not adjust for alignment in the editor. When you have Previewed and are satisfied with the appearance, click Submit - don't forget this step - i've had to re-do because of this icon_redface.gif )

When you post the requested info, someone will be able to help.
Back to top
View user's profile Send private message
Eddie Wilson

New User


Joined: 04 Feb 2009
Posts: 8
Location: Scotland

PostPosted: Mon Feb 16, 2009 5:03 pm
Reply with quote

Code:
Display  Filter  View  Print  Options  Help                                 
 -------------------------------------------------------------------------------
 SDSF OUTPUT DISPLAY SUDLDU05 JOB06932  DSID   103 LINE 4       COLUMNS 02- 81 
 COMMAND INPUT ===>                                            SCROLL ===> CSR 
 SYSIN :                                                                       
    SORT FIELDS=(1,4,CH,A,                                               0003001
                 5,3,CH,A,                                               0004001
                 8,2,CH,A,                                               0005001
                 10,1,CH,A,                                              0006001
                 11,3,CH,A,                                              0007001
                 14,2,CH,A,                                              0007101
                 16,5,CH,A,                                              0007201
                 21,22,CH,A,                                             0007301
                 43,10,CH,A,                                             0007401
                 95,10,CH,A,                                             0007501
                 53,2,CH,A,                                              0007601
                 55,19,ZD,A                                              0007701
                           *                                                   
                 75,19,ZD,A                                              0007801
                 *                                                             
                 132,8,CH,A)                                             0007901
                 *                                                             
                                                                         0008000
    INREC OVERLAY=(55:55,20,SFF,TO=PD,LENGTH=9,10X,                      0013001
                   75:75,20,SFF,TO=PD,LENGTH=9,10X)                      0014001
                                                                         0016000
    SUM FIELDS=(55,9,PD,75,9,PD)                                         0018001
                                                                         0021000
    OUTREC FIELDS=(1,54,                                                 0024100
                  (55:55,9,PD,                                           0024200
                  *                                                             
                   EDIT=(TTTTTTTTTTTT.TTTTTTS),SIGNS=(+,-),              0025000
   Display  Filter  View  Print  Options  Help                                 
 -------------------------------------------------------------------------------
 SDSF OUTPUT DISPLAY SUDLDU05 JOB06932  DSID   103 LINE 32      COLUMNS 02- 81 
 COMMAND INPUT ===>                                            SCROLL ===> CSR 
                   75:75,9,PD,                                           0026000
                   EDIT=(TTTTTTTTTTTTTTTT.TTS),SIGNS=(+,-),              0027000
                   95,10)                                                0028000

Code:
 WER268A  SORT STATEMENT    : SYNTAX ERROR                                     
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT                               
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT                               
 WER268A  OUTREC STATEMENT  : SYNTAX ERROR                                     
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 
******************************** BOTTOM OF DATA ********************************
                                                                               
 
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Mon Feb 16, 2009 5:12 pm
Reply with quote

Hi Eddie,

you seem to be missing a couple of commas for following
Code:

  55,19,ZD,A
  75,19,ZD,A


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

New User


Joined: 04 Feb 2009
Posts: 8
Location: Scotland

PostPosted: Mon Feb 16, 2009 8:36 pm
Reply with quote

Thanks. I've now fixed this.

I'm having problems converting to PD and back again.

My input fields are of the format:
TTTTTTTTTTTT.TTTTTTS 12 significant and 6 decimal followed by sign
TTTTTTTTTTTTTTTT.TTS 16 significant and 2 decima follwoed by sign

I want to convert them to PD, sum on these fields and then convert back to the above format.

However, my results are of the format:
TTTTTTTTTTT.TTTTTTBB (where B=blank) 11 significant and 6 decimal followed by 2 blank spaces
TTTTTTTTTTTTTT.TTBB 14 significant and 2 decimal followed by 2 blank spaces.


Can anyone help?

Here are my statements:
Code:

 .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
   Display  Filter  View  Print  Options  Help                                 
 -------------------------------------------------------------------------------
 SDSF OUTPUT DISPLAY SUDLDU05 JOB09783  DSID   103 LINE 0       COLUMNS 02- 81 
 COMMAND INPUT ===>                                            SCROLL ===> CSR 
********************************* TOP OF DATA **********************************
 SYNCSORT FOR Z/OS  1.3.1.0R    U.S. PATENTS: 4210961, 5117495   (C) 2007 SYNCSO
                                STANDARD LIFE     FOR ALL OF YOUR LIFE   z/OS   
 SYNCSORT LICENSED FOR CPU SERIAL NUMBER 0EDEA, MODEL 2094 711             LICEN
 SYSIN :                                                                       
    SORT FIELDS=(1,4,CH,A,                                               0003001
                 5,3,CH,A,                                               0004001
                 8,2,CH,A,                                               0005001
                 10,1,CH,A,                                              0006001
                 11,3,CH,A,                                              0007001
                 14,2,CH,A,                                              0007101
                 16,5,CH,A,                                              0007201
                 21,22,CH,A,                                             0007301
                 43,10,CH,A,                                             0007401
                 95,10,CH,A,                                             0007501
                 53,2,CH,A,                                              0007601
                 132,8,CH,A)                                             0007901
                                                                         0008000
    INREC OVERLAY=(55:55,20,SFF,TO=PD,LENGTH=10,10X,                     0012701
                   75:75,20,SFF,TO=PD,LENGTH=10,10X)                     0012801
                                                                         0012811
    SUM FIELDS=(55,10,PD,                                                0012901
                75,10,PD)                                                0013001
                                                                         0014001
    OUTREC OVERLAY=(55:55,10,PD,EDIT=(TTTTTTTTTTT.TTTTTTS),SIGNS=(,-),   0015002
                    75:75,10,PD,EDIT=(TTTTTTTTTTTTTT.TTS),SIGNS=(,-))    0016002
 WER108I  SORTIN   : RECFM=FB   ; LRECL=   150; BLKSIZE= 27900     
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: Tue Feb 17, 2009 2:18 am
Reply with quote

Hello,

There may be no need to convert to pd and then back. . .

You are running the current release of Syncsort (1.3) and may be able to sum sff fields directly - might be worth a try . . .
Back to top
View user's profile Send private message
Eddie Wilson

New User


Joined: 04 Feb 2009
Posts: 8
Location: Scotland

PostPosted: Tue Feb 17, 2009 5:23 pm
Reply with quote

I have tried this but get a syntax error:

Code:
   Display  Filter  View  Print  Options  Help                                 
 -------------------------------------------------------------------------------
 SDSF OUTPUT DISPLAY SUDLDU05 JOB02153  DSID   103 LINE 0       COLUMNS 02- 81 
 COMMAND INPUT ===>                                            SCROLL ===> CSR 
********************************* TOP OF DATA **********************************
 SYNCSORT FOR Z/OS  1.3.1.0R    U.S. PATENTS: 4210961, 5117495   (C) 2007 SYNCSO
                                STANDARD LIFE     FOR ALL OF YOUR LIFE   z/OS   
 SYNCSORT LICENSED FOR CPU SERIAL NUMBER 0EDEA, MODEL 2094 711             LICEN
 SYSIN :                                                                       
    SORT FIELDS=(1,4,CH,A,                                                     
                 5,3,CH,A,                                                     
                 8,2,CH,A,                                                     
                 10,1,CH,A,                                                     
                 11,3,CH,A,                                                     
                 14,2,CH,A,                                                     
                 16,5,CH,A,                                                     
                 21,22,CH,A,                                                   
                 43,10,CH,A,                                                   
                 95,10,CH,A,                                                   
                 53,2,CH,A,                                                     
                 132,8,CH,A)                                                   
                                                                               
    SUM FIELDS=(55,20,SFF,                                                     
                     *                                                         
                75,20,SFF)                                                     
 WER268A  SUM STATEMENT     : SYNTAX ERROR                                     
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 
******************************** BOTTOM OF DATA ********************************
                                                                               
                                                                               
 .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
   File  Edit  Edit_Settings  Menu  Utilities  Compilers  Test  Help 
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Tue Feb 17, 2009 9:56 pm
Reply with quote

Eddie wrote:
SUM FIELDS=(55,20,SFF,
*
75,20,SFF)
WER268A SUM STATEMENT : SYNTAX ERROR

SyncSort supports BI, FI, FL, PD or ZD formats for SUM Fields. SFF and UFF are not supported formats for the SUM statement.
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 Feb 18, 2009 12:41 am
Reply with quote

Hello Eddie,

Sorry 'bout the mis-cue with summing the sff fields icon_redface.gif

Have you been able to get the output you want?
Back to top
View user's profile Send private message
Eddie Wilson

New User


Joined: 04 Feb 2009
Posts: 8
Location: Scotland

PostPosted: Wed Feb 18, 2009 2:08 am
Reply with quote

I have managed to sort, sum and edit the data as required.
Thanks to everyone for their help.
Here is my solution. If you can suggest a better way that combines the 2 steps into 1 then I would be happy to know.

Code:
 ****** ***************************** Top of Data ******************************
 000001    SORT FIELDS=(1,4,CH,A,                                               
 000002                 5,3,CH,A,                                               
 000003                 8,2,CH,A,                                               
 000004                 10,1,CH,A,                                             
 000005                 11,3,CH,A,                                             
 000006                 14,2,CH,A,                                             
 000007                 16,5,CH,A,                                             
 000008                 21,22,CH,A,                                             
 000009                 43,10,CH,A,                                             
 000010                 95,10,CH,A,                                             
 000011                 53,2,CH,A,                                             
 000012                 132,8,CH,A)                                             
 000013                                                                         
 000014    INREC OVERLAY=(55:55,20,SFF,TO=PD,LENGTH=10,10X,                     
 000015                   75:75,20,SFF,TO=PD,LENGTH=10,10X)                     
 000016                                                                         
 000017    SUM FIELDS=(55,10,75,10),FORMAT=PD                                   
 000018                                                                         
 000019    OUTREC OVERLAY=(55:55,10,PD,EDIT=(STTTTTTTTTTTT.TTTTTT),SIGNS=(,-), 
 000020                    75:75,10,PD,EDIT=(STTTTTTTTTTTTTTTT.TT),SIGNS=(,-)) 
 ****** **************************** Bottom of Data ****************************


Step 2:

Code:
 ****** ***************************** Top of Data ******************************
 000300    SORT FIELDS=COPY                                                     
 000800                                                                         
 001500    OUTREC BUILD=(1:1,10,                                               
 001600                  11:16,39,                                             
 001700                  50:56,19,                                             
 001800                  69:55,1,                                               
 001900                  70:76,19,                                             
 002000                  89:75,1,                                               
 002100                  90:95,10)                                             
 ****** **************************** Bottom of Data ****************************
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Wed Feb 18, 2009 3:20 am
Reply with quote

Eddie, try this untested JCL:

Code:
SORT FIELDS=(1,4,CH,A,                                               
             5,3,CH,A,                                               
             8,2,CH,A,                                               
            10,1,CH,A,                                             
            11,3,CH,A,                                             
            14,2,CH,A,                                             
            16,5,CH,A,                                             
            21,22,CH,A,                                             
            43,10,CH,A,                                             
            95,10,CH,A,                                             
            53,2,CH,A,                                             
           132,8,CH,A)                                             
INREC OVERLAY=(55:55,20,SFF,TO=PD,LENGTH=10,10X,                     
               75:75,20,SFF,TO=PD,LENGTH=10,10X)                     
SUM FIELDS=(55,10,75,10),FORMAT=PD                                   
OUTREC IFTHEN=(WHEN=INIT,
       OVERLAY=(55:55,10,PD,EDIT=(STTTTTTTTTTTT.TTTTTT),SIGNS=(,-),
                75:75,10,PD,EDIT=(STTTTTTTTTTTTTTTT.TT),SIGNS=(,-)),
       IFTHEN=(WHEN=INIT,
       BUILD=(1:1,10,                                               
             11:16,39,                                             
             50:56,19,                                             
             69:55,1,                                               
             70:76,19,                                             
             89:75,1,                                               
             90:95,10))
Back to top
View user's profile Send private message
Eddie Wilson

New User


Joined: 04 Feb 2009
Posts: 8
Location: Scotland

PostPosted: Wed Feb 18, 2009 3:29 pm
Reply with quote

Code:
.  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
   Display  Filter  View  Print  Options  Help                                 
 -------------------------------------------------------------------------------
 SDSF OUTPUT DISPLAY SUDLDU06 JOB09795  DSID   101 LINE 0       COLUMNS 02- 81 
 COMMAND INPUT ===>                                            SCROLL ===> CSR 
********************************* TOP OF DATA **********************************
 SYNCSORT FOR Z/OS  1.3.1.0R    U.S. PATENTS: 4210961, 5117495   (C) 2007 SYNCSO
                                STANDARD LIFE     FOR ALL OF YOUR LIFE   z/OS   
 SYNCSORT LICENSED FOR CPU SERIAL NUMBER 0EDEA, MODEL 2094 711             LICEN
 SYSIN :                                                                       
    SORT FIELDS=(1,4,CH,A,                                                     
                 5,3,CH,A,                                                     
                 8,2,CH,A,                                                     
                 10,1,CH,A,                                                     
                 11,3,CH,A,                                                     
                 14,2,CH,A,                                                     
                 16,5,CH,A,                                                     
                 21,22,CH,A,                                                   
                 43,10,CH,A,                                                   
                 95,10,CH,A,                                                   
                 53,2,CH,A,                                                     
                 132,8,CH,A)                                                   
                                                                               
    INREC OVERLAY=(55:55,20,SFF,TO=PD,LENGTH=10,10X,                           
                   75:75,20,SFF,TO=PD,LENGTH=10,10X)                           
                                                                               
    SUM FIELDS=(55,10,75,10),FORMAT=PD                                         
                                                                               
 *  OUTREC OVERLAY=(55:55,10,PD,EDIT=(STTTTTTTTTTTT.TTTTTT),SIGNS=(,-),         
 *                  75:75,10,PD,EDIT=(STTTTTTTTTTTTTTTT.TT),SIGNS=(,-))         
    OUTREC IFTHEN=(WHEN=INIT,                                                   
           OVERLAY=(55:55,10,PD,EDIT=(STTTTTTTTTTTT.TTTTTT),SIGNS=(,-),         
                    75:75,10,PD,EDIT=(STTTTTTTTTTTTTTTT.TT),SIGNS=(,-)),       
           IFTHEN=(WHEN=INIT,                                                   
           *                                                                   
           BUILD=(1:1,10,                                                       
                 11:16,39,                                                     
                 50:56,19,                                                     
                 69:55,1,                                                       
                 70:76,19,                                                     
                 89:75,1,                                                       
                 90:95,10))                                                     
 WER268A  OUTREC STATEMENT  : SYNTAX ERROR                                     
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 
******************************** BOTTOM OF DATA ********************************
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Wed Feb 18, 2009 8:48 pm
Reply with quote

Try changing OUTREC to OUTFIL. Let me know if that resolves the issue.
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top