Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

unpacking date from packed Alphanumeric field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
achittu

New User


Joined: 26 Feb 2007
Posts: 14
Location: chennai

PostPosted: Fri Jul 15, 2011 4:35 pm    Post subject: unpacking date from packed Alphanumeric field
Reply with quote

I have a three byte alphanumeric field which contains 6 digit date ( DDMMYY format)

Now I need to unpack the packed 6 digit date value from the 3 byte alpha numeric field and move it to a display format. Currently I cannot view it since it is in packed mode. I do not know whether it is Binary or Comp - 3
but when I view in File Aid in normal mode ( NOT HEX mode) , I see the value as X'290910' ( represents date value of 290910) now I want this value of 290910 move to a display format field.

I tried using the below sort

Code:

  SORT FIELDS=COPY                                               
  OUTREC FIELDS=(1:1,359,360:360,3,PD,TO=ZD,LENGTH=6,366:363,531)


Here 360 onwards 3 byte field contains the date field. This Sort does not give me the correct value of 290910. Instead it gives me 029091. I have tried giving BI ( binary) instead of PD but still does not give me the desired results.

Not sure where I went wrong. Can you suggest appropriate sort step for achieving the above
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Jul 15, 2011 10:47 pm    Post subject:
Reply with quote

X'290910' is NOT PD so you can't use PD to display it.

You can use HEX like this:

Code:

  SORT FIELDS=COPY
  OUTREC FIELDS=(1:1,359,360:360,3,HEX,366:363,531)
Back to top
View user's profile Send private message
achittu

New User


Joined: 26 Feb 2007
Posts: 14
Location: chennai

PostPosted: Sat Jul 16, 2011 12:28 am    Post subject:
Reply with quote

Thanks a lot Frank. It is working as desired
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us