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

Date conversion using SORT


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chillmo

New User


Joined: 31 Aug 2017
Posts: 21
Location: USA

PostPosted: Fri Jan 15, 2021 10:23 am
Reply with quote

I'm trying to convert a packed date, format is MMDDYY PIC S9(6) COMP-3, to 0MMDDCCYY PIC X(9) using sort.

Here's the input and my error message:
Code:


0181
002C

103:78,4,Y2U,TOGREG=Y4T,
       *               
WER271A  OUTREC STATEMENT  : NUMERIC FIELD ERROR
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000   
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE   


Any assistance would be greatly appreciated.
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


Joined: 15 Aug 2015
Posts: 607
Location: Bamberg, Germany

PostPosted: Fri Jan 15, 2021 10:58 am
Reply with quote

There is no p,4,Y2U comparison, simple as that. Only 2 or 3 are permissible values.
Back to top
View user's profile Send private message
chillmo

New User


Joined: 31 Aug 2017
Posts: 21
Location: USA

PostPosted: Fri Jan 15, 2021 11:24 am
Reply with quote

Thanks Joerg.Findeisen!

I changed my code to:
Code:
103:78,4,Y2Y,TOGREG=Y4W,


It works; however, it displays as MMDDCCYY (8-bytes) instead of 0MMDDCCYY.

But, I'm heading in the right direction.

Thanks again!
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


Joined: 15 Aug 2015
Posts: 607
Location: Bamberg, Germany

PostPosted: Fri Jan 15, 2021 2:37 pm
Reply with quote

Could you fix it? If so, how did you? icon_question.gif
Back to top
View user's profile Send private message
sergeyken
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1188

PostPosted: Fri Jan 15, 2021 6:44 pm
Reply with quote

chillmo wrote:
Thanks Joerg.Findeisen!

I changed my code to:
Code:
103:78,4,Y2Y,TOGREG=Y4W,


It works; however, it displays as MMDDCCYY (8-bytes) instead of 0MMDDCCYY.

But, I'm heading in the right direction.

Thanks again!

There is no way to get date value as 0MMDDCCYY. It is mainly out of common sense: I start my new job on 012112021?
Extra zero is only present in packed decimal (as well as decimal sign): X’012112021C’, but you don’t want this ‘C’ to be appended to your date; I hope so?

If you need this, add prefix 0 as constant C’0’ just before your (actual) date value.
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. Sort to include records of file 2 int... Java & MQSeries 1
No new posts Converting unpacked fields to pack us... SYNCSORT 4
No new posts SORT for dynamic trailer record + CSV... DFSORT/ICETOOL 14
No new posts SORT HELP - SORT A COLUMN and GROUP B... DFSORT/ICETOOL 9
No new posts Sort w/OUTREC Question DFSORT/ICETOOL 2
Search our Forums:

Back to Top