OUTREC : Can you use EDIT and SQZ together?



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

OUTREC : Can you use EDIT and SQZ together?

Postby Ewizard » Wed Jun 18, 2014 4:48 pm

Input field is packed decimal PIC S9(07)V9(02).
0006621
002226C

I convert from this format to zoned decimal using:
7,PD,EDIT=(SIIIIIIT.TT),SIGNS=(,-,,)

I now get:
262622.61
44FFFFFF4FF
00262622B61

As you can see the first 2 bytes are spaces. I know you can use SQZ=(SHIFT=LEFT) to remove these spaces.

Can you combine the EDIT parameter and SQZ parameter within the same OUTREC statement? Or do you need 2 separate SYNCSORT's using OUTREC?

Any help/suggestions much appreciated. :)
Ewizard
 
Posts: 10
Joined: Fri Jan 29, 2010 9:41 pm
Has thanked: 0 time
Been thanked: 0 time

Re: OUTREC : Can you use EDIT and SQZ together?

Postby Ewizard » Wed Jun 18, 2014 5:03 pm

Since the above I have tried:
7,PD,EDIT=(TTTTTTT.TT)

I now get:
0262622.61.

Why do I get '.' at the end? How do I prevent this from displaying?
Ewizard
 
Posts: 10
Joined: Fri Jan 29, 2010 9:41 pm
Has thanked: 0 time
Been thanked: 0 time

Re: OUTREC : Can you use EDIT and SQZ together?

Postby BillyBoyo » Wed Jun 18, 2014 8:06 pm

Yes, you can do it all in one step.

Why you are getting something after the value is extremely difficult to say if you don't show your Control Cards and the input data which gives you that.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: OUTREC : Can you use EDIT and SQZ together?

Postby Ewizard » Thu Jun 19, 2014 2:13 pm

Hi BillyBoyo. Thanks for replying.

Here is the input field in packed format:

7/PS               
(15-21)                           
0006621           
002226C


Here are the control cards:
SORT FIELDS=COPY                           
OUTREC FIELDS=(1:1,10,                     
               C',',                       
               12:15,7,PD,EDIT=(TTTTTTT.TT))


Code'd
Ewizard
 
Posts: 10
Joined: Fri Jan 29, 2010 9:41 pm
Has thanked: 0 time
Been thanked: 0 time

Re: OUTREC : Can you use EDIT and SQZ together?

Postby BillyBoyo » Thu Jun 19, 2014 2:42 pm

SORT FIELDS=COPY                           
OUTREC BUILD=(1,10,                     
              C',',                       
              15,7,PD,
                EDIT=(TTTTTTT.TT))


Can you post the sysout from the step, sample input and output, please?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: OUTREC : Can you use EDIT and SQZ together?

Postby Ewizard » Thu Jun 19, 2014 3:20 pm

Please Note this is just the first few fields of the record as per the Control card as an attempt to see if it worked.

Is this what you want?

Sample Input using option 8.FAM with a copybook for field layout.
2/AN         1/AN    2/AN         1/AN    4/AN  4/AN         SCHED-PREM(1)
(1-2)         (3-3)    (4-5)          (6-6)    (7-10)  (11-14)     (15-21)R
12             /          06             /         2014                                 
FF             6          FF             6         FFFF    4444          0006621
12             1          06             1         2014    0000          002226C


Sysout:
SYSIN :                                                                       
 SORT FIELDS=COPY                                                             
 OUTREC FIELDS=(1:1,10,                                                       
                C',',                                                         
                12:15,7,PD,EDIT=(TTTTTTT.TT))                                 
WER108I  SORTIN   : RECFM=FB   ; LRECL=    99; BLKSIZE= 27918                 
WER073I  SORTIN   : DSNAME=VA.PROD.REASSURE.SCHED.UCGR.M201406               
WER237I  OUTREC RECORD LENGTH =    21                                         
WER110I  SORTOUT  : RECFM=FB   ; LRECL=    22; BLKSIZE= 22000                 
WER074I  SORTOUT  : DSNAME=VA.TEST.REASSURE.SCHED.UCGR.EW1                   
WER462I  OUTPUT LRECL DIFFERS FROM SORTOUT LRECL                             
WER054I  RCD IN       1103, OUT       1103                                   
WER169I  RELEASE 1.4 BATCH 0525 TPF LEVEL 1.0                                 
WER052I  END SYNCSORT - VAEWOS05,JSTEP010,,DIAG=EE00,71C0,C288,00CE,A666,48CB,


Sample Output:
12/06/2014,0262622.61.


Code'd
Ewizard
 
Posts: 10
Joined: Fri Jan 29, 2010 9:41 pm
Has thanked: 0 time
Been thanked: 0 time

Re: OUTREC : Can you use EDIT and SQZ together?

Postby BillyBoyo » Thu Jun 19, 2014 4:09 pm

Yes, except you forgot the Code tags again (use the Quote button on your latest post if you want to see how to get that effect).

Now look at your sysout:

WER108I  SORTIN   : RECFM=FB   ; LRECL=    99; BLKSIZE= 27918                 
...
WER237I  OUTREC RECORD LENGTH =    21                                         
WER110I  SORTOUT  : RECFM=FB   ; LRECL=    22; BLKSIZE= 22000                 
...
WER462I  OUTPUT LRECL DIFFERS FROM SORTOUT LRECL               


Look at the nice BLKSIZE of your input. The optimal blocksize is 27998, so 27918 is closest (when less than) you can get to that.

Now look at the output. 22000. Miles away. Look at the LRECL. 22. Look at the WER237I message. 21. Lookt at the WER462I.

So, from your JCL, remove the LRECL and BLKSIZE (SORT will allocate those) and your spare byte (which if you look in hex was probably X'00') will disappear.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: OUTREC : Can you use EDIT and SQZ together?

Postby Ewizard » Thu Jun 19, 2014 4:33 pm

Thanks BillyBoyo.
That is now fixed.

I am interested to know the syntax for including parameters EDIT and SQZ in the OUTREC statement.
Ewizard
 
Posts: 10
Joined: Fri Jan 29, 2010 9:41 pm
Has thanked: 0 time
Been thanked: 0 time

Re: OUTREC : Can you use EDIT and SQZ together?

Postby BillyBoyo » Thu Jun 19, 2014 6:46 pm

You will EDIT first, and then SQZ. So it is the syntax of SQZ that you need.

I'd use INREC, since you have no actual need to use OUTREC (the main difference is INREC is processed before SORT/SUM, and OUTREC after).

What you may be unaware of is the use of multiple IFTHEN=(WHEN=INIT, which allow for unconditional processing of the record more than once.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post