Page 1 of 1

DFSORT help

PostPosted: Fri Jul 03, 2020 6:23 pm
by cmarta001
Hi, I am trying to use DFSORT (Type SFF) to remove spaces from the following file and get RC=16 Syntax error. Can somebody please help.

Here's the file:

Command ===>                                                  Scroll ===> CSR  
****** ***************************** Top of Data ******************************
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
000001 EN 706 43 L 02 014 1616 0000 000000               0.00        -331,824.8
000002 EN 706 43 L 02 018 0100 0054 000000    -253,180,404.57     -75,184,444.7
000003 EN 706 43 L 02 100 0100 0735 000000     132,603,505.15     137,821,581.8
 

Here's my UTILOPC:

   SORT FIELDS=COPY                          
                                             
 OUTREC FIELDS=(01,35,CH,                    
                37,18,SFF,TO=PD,LENGTH=8,    
                56,18,SFF,TO=PD,LENGTH=8,    
                75,18,SFF,TO=PD,LENGTH=8,    
                94,18,SFF,TO=PD,LENGTH=8);    
 

Here's the SYNTAX ERROR:

E SYNTAX ERROR                                                        
                  H=8,75,18,SFF,TO=PD,LENGTH=8,94,18,SFF,TO=PD,LENGTH=8)
 0 C5-I58435 C6-BASE   C7-I58435 C8-I58435 E7-I58377                    
 

Thanks
Coded for you - next time do it yourself

Re: DFSORT help

PostPosted: Fri Jul 03, 2020 7:55 pm
by NicC
It's not a file it's a dataset.
Please present code within code tags
Please present all the sort messages including the message id
I suspect you are missing a load of parentheses.

Re: DFSORT help

PostPosted: Fri Jul 03, 2020 8:08 pm
by cmarta001
Thanks Nic. I've never did DFSORT SFF before, I don't understand what you're asking...

This is all I have, the goal is to remove spaced between each field:

SORT FIELDS=COPY

OUTREC FIELDS=(01,35,CH,
37,18,SFF,TO=PD,LENGTH=8,
56,18,SFF,TO=PD,LENGTH=8,
75,18,SFF,TO=PD,LENGTH=8,
94,18,SFF,TO=PD,LENGTH=8);

Re: DFSORT help

PostPosted: Sat Jul 04, 2020 1:17 pm
by NicC
You still have not presented the DFSORT output messages which should be with1n code tags to preserve alignment as should your code. Use the full editor if the relevant buttons are not visible.

Re: DFSORT help

PostPosted: Tue Jul 07, 2020 7:10 pm
by sergeyken
SORT utilities do not use ';' as statement separator.

It is garbage - causing the syntax error.

Re: DFSORT help

PostPosted: Tue Jul 21, 2020 7:13 pm
by knv09
Hi cmarta001,
Well, if you want just to "remove spaced" (I have interpreted it as "remove SPACES"), you do not need to deal with SFF :-)
There's a simple option in DFSORT called FINDREP: Find something and Replace it with something else (please see below);
in your case it would be Find space --> Replace with nothing
Your resulting data should not contain any spaces (if that's what you have REALLY stated as your goal)
And I suggest you to take a look as for how to use Code tags - very-very simple as well :-)
Best of luck.


//NOSPACE  EXEC PGM=ICEMAN
//SORTIN   DD *
000001 EN 706 43 L 02 014 1616 0000 000000               0.00        -33
000002 EN 706 43 L 02 018 0100 0054 000000    -253,180,404.57     -75,18
000003 EN 706 43 L 02 100 0100 0735 000000     132,603,505.15     137,82
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT FIELDS=COPY
  INREC FINDREP=(IN=C' ',OUT=C'')
  END
/*
//