Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6731587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:32:49+00:00 2026-05-26T10:32:49+00:00

I have a one query explaind below…., 1.My DB2 table column is in INTEGER

  • 0

I have a one query explaind below….,

1.My DB2 table column is in INTEGER format (it has the date value in Julian date format - YYYYDDD)

2. After unload this date into a flat file, the result is in hexa decimal format.(4 bytes occupaid)

3. I have a requirement to compare this date with (Current Julian date+7days) and write the corresponding recods into a File. 

4. So, when I am comparing the Hexa decimal Input date with Current Julian date+7days (DATE3P+7), I am getting MAxcc=0 but I am not getting required output. 

5. What I identified the problem is that the input date should also be in packed decimal format. 

Can anybody please let me know how to convert the table value in Packed decimal while unloading or please suggest alternate way to get it.

Ex:- 1. Unload Julian date (YYYYDDD) [After unload this will be in hexa decimal format].
2. compare with Current Julian date +7 days.
SORT FIELDS=COPY
OUTFIL FILES=1,
INCLUDE=(1,4,PD,LT,DATE3P+7)
OUTFIL FILES=2,SAVE

Thanks in Advance, Rajasekhar Jannu.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:32:49+00:00Added an answer on May 26, 2026 at 10:32 am

    Believe these alternate ways, work…

    • Instead of getting the date in hex type, unload it as date in YYYYDDD
      format and the DATE3 will give you the julian date in YYYYDDD. Now
      these both are in compatible format to compare and condition.

      There are many scalar functions of DB2 to provide Julian date and as
      well date in numbers. I believe DIGITS on JULIAN scalar function
      would do…

      Refer this DB2 Scalar Functions

    • If you couldnt unload the table in the way described above, another
      way would be manipulating the unload file, so that date from hex
      format needs to be converted into YYYYDDD numeric format using
      DFSORT. Then DATE3 will help u to get one week old data. DFSORT
      reference has been already shared.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a query that pulls up questions from one table and answers from
I have a sub query that returns one column, showing as GroupType, I then
I have a query that returns a result set similar to the one below:
I have a table with a DATE column with time (as usual in Oracle
I have one query on which I would like to get your valuable feedback.
I have two processes one will query other for data.There will be huge amount
G'day! I have one million different words which I'd like to query for in
I have a query that updates one record, and only one record. Is there
I have a query that always returns one row, with many columns. I would
I have a query that returns one row. However, I want to invert the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.