Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 8500

SYNCSORT :: RE: How to pick only YYMMDD from DATE1P (Hex) format?

$
0
0
Author: sergeyken
Posted: Thu Mar 23, 2017 10:35 pm (GMT 5.5)

In order to align the desired part of packed date X'0yymmddC' on the full-byte boundary you are suggested
first: to multiply it by +10 (giving you X'yymmdd0C' as the result), and
second: to use the first 3 bytes of the result.

SYNCSORT syntax doesn't allow to perform MUL operation when using any function result as its argument (like result of DATE1P); only a field of record can be used for multiplication.

You can:

1) Append the date to the original record using DATE1P function in
Code:
 INREC FIELDS=(...........,&DATE1P)
(BTW, an ampersand is required to use the function in SYNCSORT), and

2) Multiply by +10, and use only 3 bytes of the result in
Code:
OUTFIL ...,OUTREC=(...,p,l,MUL,+10,...)

_________________
Tyrannosaurus-REXX


Viewing all articles
Browse latest Browse all 8500

Trending Articles