Page 1 of 1

SYNCSORT Help

PostPosted: Fri Sep 20, 2013 3:11 am
by reddy70
I am having issues in converting a packed decimal Julian Date to Gregorian Date.
The first field at pos 20 is packed decimal and in Julian format ..I want to display this as Gregorian format in the outfile .. please see the below details .. and please help me out how to do this in one step .. there are other fields also in the report we are generating..

OUTREC FIELDS=(01:20,6,PD,EDIT=(TTTT/TTTTT),
11:17,4,PD,EDIT=(TT:TT:TTT),
21:97,10,
33:25,4,BI,EDIT=(TTTTTTTT),
43:227,44,
89:301,44)

OUTFIL FILES=OUT,
01:' JULIAN ',
11:' TIME ',
21:'NODE NAME',
33:'CONDCODE ',
46:'FROM FILE NAME',
93:'TO FILE NAME',
/,
01:'--------',
11:'---------',
21:'----------',
33:'--------',
43:'--------------------------------------------',
89:'--------------------------------------------')

OUTPUT File is Like This:
JULIAN TIME
-------- ---------
2013/260 00:09:294
2013/260 00:13:011
2013/260 13:11:547
2013/260 13:12:094

Re: SYNCSORT Help

PostPosted: Fri Sep 20, 2013 4:12 am
by BillyBoyo
What version of SyncSort are you on?

Re: SYNCSORT Help

PostPosted: Fri Sep 20, 2013 5:11 am
by reddy70
SYNCSORT FOR Z/OS 1.4.0.1R

Re: SYNCSORT Help

PostPosted: Fri Sep 20, 2013 1:49 pm
by BillyBoyo
Have you looked at DT and DTNS in your documentation?

Please don't post the same question again. The duplicate has been deleted.

Re: SYNCSORT Help

PostPosted: Fri Sep 20, 2013 5:37 pm
by reddy70
Yes .. but i want to unpack the PD and convert into Gregorian in the same step .. Can it be possible?
(01:20,6,PD,EDIT=(TTTT/TTTTT), This is giving me date 2013/260 . we want this date to display in mm/dd/yyyy format.

Re: SYNCSORT Help

PostPosted: Fri Sep 20, 2013 6:28 pm
by BillyBoyo
 INREC IFTHEN=(WHEN=INIT,
               BUILD=(20,6,PD,TO=ZD,LENGTH=7,3X,
                      20,6,PD,EDIT=(TTTT/TTTTT),
                      17,4,PD,EDIT=(TT:TT:TTT),
                      97,10,
                      25,4,BI,EDIT=(TTTTTTTT),
                      227,44,
                      301,44),
       IFTHEN=(WHEN=INIT,
               OVERLAY=(1,7,Y4T,DT=(MD4/))


Try something like this. Untested, so fix it up yourself.

Unless you need to use OUTREC, use INREC.

Don't use FIELDS on INREC, OUTREC or OUTFIL (or OUTREC on OUTFIL). They are there for backwards compatibility only. Use BUILD instead.

You make things harder for yourself by specifying the columns on BUILD if all your fields are contiguous.

Re: SYNCSORT Help

PostPosted: Fri Sep 20, 2013 7:23 pm
by tivrfoa
BillyBoyo wrote:Don't use FIELDS on INREC, OUTREC or OUTFIL (or OUTREC on OUTFIL). They are there for backwards compatibility only. Use BUILD instead.

Thanks for mentioning this. Now I'm wondering if there's any difference in performance (I'll seach and make a test), or if it's just to use new capabilities.
I found this http://ibmmainframes.com/about16425.html where Frank mentioned that BUILD is just an alias for FIELDS, but the post is from 2006.
But in this post from 2010 http://ibmmainframes.com/about52530.html he mentioned that BUILD is preferred.

Re: SYNCSORT Help

PostPosted: Fri Sep 20, 2013 8:12 pm
by reddy70
Thank you Billybo .. I really appreciate your help .. I tried this.. we are using the headers also .. I am getting errors

WER268A INREC STATEMENT : SYNTAX ERROR
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
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT

-------------------------------------


INREC IFTHEN=(WHEN=INIT,
              BUILD=(20,6,PD,TO=ZD,LENGTH=7,3X,
                     20,6,PD,EDIT=(TTTT/TTTTT),
                     17,4,PD,EDIT=(TT:TT:TTT),
                     97,10,
                     25,4,BI,EDIT=(TTTTTTTT),
                     227,44,
                     301,44,
                     157,8,BI,EDIT=(III,III,III),
                     165,4,BI,EDIT=(I,III,III,III),
      IFTHEN=(WHEN=INIT,
              OVERLAY=(1,7,Y4T,DT=MD4/))
HEADER2=(01:'ZY0000I0-N44',
         53:'xxxxxxxxxxxxxxxxxxxxxx',
        121:'PAGE:',
        127:&PAGE,
         /,
         56:xxxxxxxxxxxxxxxxx',
        113:'RUN DATE:',
        125:&DATE,
/,
01:' DATE ',
11:' TIME ',
21:'NODE NAME',
33:'CONDCODE ',
46:'FROM FILE NAME',
93:'TO FILE NAME',
35:'I/O BYTES',
47:'RECORD COUNT',
/,
01:'--------',
11:'---------',
21:'----------',
33:'--------',
43:'--------------------------------------------',

 89:'--------------------------------------------',
134:'-----------',
145:'--------------')


Code'd

Re: SYNCSORT Help

PostPosted: Fri Sep 20, 2013 8:18 pm
by BillyBoyo
Good searching. I don't think there will be the slightest difference in performance. If Frank Yaeger said BUILD is an alias, it will mean that the identical code is processed as with FIELDS on INREC/OUTREC/OUTFIL.

SORT/MERGE FIELDS=

REFORMAT FIELDS=

Here FIELDS mean different things and are different to the FIELDS we are talking about. By not using FIELDS where there is an option not to, it just removes potential confusion.

OUTREC .... outrec stuff

OUTFIL OUTREC=

Again, removes confusion to use BUILD in place of OUTREC on OUTFIL.

Internally I imagine the processing is the same. It's just a question of clarity.

Re: SYNCSORT Help

PostPosted: Fri Sep 20, 2013 8:22 pm
by BillyBoyo
If that is your entire set of Control Cards, you need to specify a SORT, MERGE or OPTION COPY.

You can use SORT FIELDS=COPY, I prefer OPTION COPY, they do the same thing.

No SORT Control Cards should start in Column one.

HEADERn/TRAILERn are part of OUTFIL, so you need an OUTFIL.

I'm reminded by your error messages that this is SyncSort. What Frank Yaeger says applies to DFSORT. For SyncSort, it is up to how they implemented FIELDS/OUTREC/BUILD. I'd suspect in a similar manner, but have no clue.