Sorry, you do not have permission to ask a question, You must login to ask a question.

Sorry, you do not have permission to ask a question.

brainchime.com

brainchime.com

brainchime.com Navigation

    • Home
    • About Us
    • Contact Us

Mobile menu

Close
  • Home
  • Categories
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags

brainchime.com Latest Questions

Admin
Admin
Asked: October 6, 20242024-10-06T19:05:38+05:30 2024-10-06T19:05:38+05:30In: IBM i

Date, Time or Timestamp value is not valid (C G D F)

I was converting the timestamp to date in the RPGLE program and was getting the run time error Date, Time or Timestamp value is not valid (C G D F).

 Additional Message Information 

Message ID . . . . . . : RNQ0112 Severity . . . . . . . : 99 
Message type . . . . . : Inquiry 
Date sent . . . . . . : 09/02/24 Time sent . . . . . . : 09:03:48 

Message . . . . : Date, Time or Timestamp value is not valid (C G D F). 
Cause . . . . . : RPG procedure TESTDATE in program TESTLIB/TESTDATE, at 
statement 4 referenced a Date, Time or Timestamp variable which contained a 
value which is not valid. Some examples of values which are not valid are: 
-- A date of 1994/02/31, which is not possible. 
-- A time of 01/03:04, which does not have correct separators. 
Recovery . . . : Contact the person responsible for program maintenance to 
determine the cause of the problem. 
Possible choices for replying to message . . . . . . . . . . . . . . . : 
D -- Obtain RPG formatted dump. 
S -- Obtain system dump. 
F -- Obtain full formatted dump. 

Application error. RNX0112 unmonitored by TESTDATE at statement 0000000004,

This is the dump that I have taken,

ILE RPG FORMATTED DUMP 
Program Status Area: 
Procedure Name . . . . . . . . . . . . : TESTDATE 
Program Name . . . . . . . . . . . . . : TESTDATE 
Library . . . . . . . . . . . . . . : TESTLIB
Module Name. . . . . . . . . . . . . . : TESTDATE 
Program Status . . . . . . . . . . . . : 00112 
Date, Time or Timestamp value is not valid (C G D F). 
Previous Status . . . . . . . . . . . : 00000 
Statement in Error . . . . . . . . . . : 00000004 
RPG Routine . . . . . . . . . . . . . : *DETC 
Number of Parameters . . . . . . . . . : 
Message Type . . . . . . . . . . . . . : RNX 
Additional Message Info . . . . . . . : 0112 
Message Data . . . . . . . . . . . . . : 
Date, Time or Timestamp value is not valid. 
Status that caused RNX9001 . . . . . . : 
Last File Used . . . . . . . . . . . . : 
 Last File Status . . . . . . . . . . . : 
Last File Operation . . . . . . . . . : 
Last File Routine . . . . . . . . . . : 
Last File Statement . . . . . . . . . : 
Last File Record Name . . . . . . . . : 
Job Name . . . . . . . . . . . . . . . : QPAD082410 
User Name . . . . . . . . . . . . . . : ADMIN
Job Number . . . . . . . . . . . . . . : 204501 
Date Entered System . . . . . . . . . : 09022024 
Century . . . . . . . . . . . . . . : 20 
Date Started . . . . . . . . . . . . . : *N/A* 
Time Started . . . . . . . . . . . . . : *N/A* 
Compile Date . . . . . . . . . . . . . : 090224 
Compile Time . . . . . . . . . . . . . : 090652 
Compiler Level . . . . . . . . . . . . : 0001 
Source File . . . . . . . . . . . . . : QNA 
Library . . . . . . . . . . . . . . : TESTLIB 
Member . . . . . . . . . . . . . . . . : TESTDATE 
ILE RPG FORMATTED DUMP 
Module Name. . . . . . . . . . . . . . : TESTDATE 
Optimization Level . . . . . . . . . . : *NONE 
Halt Indicators: 
H1 '0' H2 '0' H3 '0' H4 '0' H5 '0' H6 '0' H7 '0' H8 '0' H9 '0' 
Command/Function Key Indicators: 
KA '0' KB '0' KC '0' KD '0' KE '0' KF '0' KG '0' KH '0' KI '0' KJ '0'
KK '0' KL '0' KM '0' KN '0' KP '0' KQ '0' KR '0' KS '0' KT '0' KU '0'
KV '0' KW '0' KX '0' KY '0' 
Control Level Indicators: 
L1 '0' L2 '0' L3 '0' L4 '0' L5 '0' L6 '0' L7 '0' L8 '0' L9 '0' 
Overflow Indicators: 
OA '0' OB '0' OC '0' OD '0' OE '0' OF '0' OG '0' OV '0' 
External Indicators: 
U1 '0' U2 '0' U3 '0' U4 '0' U5 '0' U6 '0' U7 '0' U8 '0' 
General Indicators: 
01 '0' 02 '0' 03 '0' 04 '0' 05 '0' 06 '0' 07 '0' 08 '0' 09 '0' 10 '0'
11 '0' 12 '0' 13 '0' 14 '0' 15 '0' 16 '0' 17 '0' 18 '0' 19 '0' 20 '0'
 21 '0' 22 '0' 23 '0' 24 '0' 25 '0' 26 '0' 27 '0' 28 '0' 29 '0' 30 '0' 
31 '0' 32 '0' 33 '0' 34 '0' 35 '0' 36 '0' 37 '0' 38 '0' 39 '0' 40 '0' 
41 '0' 42 '0' 43 '0' 44 '0' 45 '0' 46 '0' 47 '0' 48 '0' 49 '0' 50 '0' 
51 '0' 52 '0' 53 '0' 54 '0' 55 '0' 56 '0' 57 '0' 58 '0' 59 '0' 60 '0' 
61 '0' 62 '0' 63 '0' 64 '0' 65 '0' 66 '0' 67 '0' 68 '0' 69 '0' 70 '0' 
71 '0' 72 '0' 73 '0' 74 '0' 75 '0' 76 '0' 77 '0' 78 '0' 79 '0' 80 '0' 
81 '0' 82 '0' 83 '0' 84 '0' 85 '0' 86 '0' 87 '0' 88 '0' 89 '0' 90 '0' 
91 '0' 92 '0' 93 '0' 94 '0' 95 '0' 96 '0' 97 '0' 98 '0' 99 '0' 
Internal Indicators: 
LR '0' MR '0' RT '0' 1P '0' 
NAME ATTRIBUTES VALUE 
DATE1 DATE(10) '0001-01-01' 'F0F0F0F160F0F160F0F1'X 
TIMESTAMP1 TIMESTAMP(26) '0001-01-01-00.00.00.000000' 
VALUE IN HEX 'F0F0F0F160F0F160F0F160F0F04BF0F04BF0F04BF0F0F0F0F0F0'X
* * * * * E N D O F R P G D U M P * * * * * 

The source code is

      Dtimestamp1       s               Z 
      Ddate1            s               D 
       /free                              
        date1 = %date('2024-03-16-15.10.40.456465');  
        return;
       /end-free 

Line 1: I declared a timestamp variable timestamp1.
Line 2: Declared a date variable date1.
Line 3 & 6: /free and /end-free block to write rpg-free code.
Line 4: Passing the timestamp value in character format to %date built-in function and evaluating the result date in the date1 variable.
Line 5: return from the RPG program.

what I am doing wrong here date1 = %date(‘2024-03-16-15.10.40.456465’); for which I am getting an invalid timestamp value error.

as400rpg
  • 0
  • 0
  • 11
  • 3
  • Share
    • Share on Facebook
    • Share on Twitter
    • Share on LinkedIn
    • Share on WhatsApp

Related Questions

  • what is level check error and how to resolve level check error?
  • What are AS400 systems. Please provide a introduction of AS400 systems?
  • Is there any online server available for practicing on AS400 system?
  • What are the menus available in AS400?
  • What is subsystem in AS400?
  • How to copy a save file from IFS to a library?
  • How to transfer savf from as400 to pc?
  • How to copy ifs file to another directory?
  • How to copy savf from ifs to pc?
  • How to copy ifs file to physical file?
  • How to copy save file to ifs?
  • How to copy spool file to ifs?
  • How to copy physical file to ifs?
  • How to copy file from pc to IFS?
  • How to download spool file from AS400?
  • How do I delete a library in AS400?
  • How do I copy data from AS400 to excel?
  • What is library in AS400?
  • How to find all the source physical file available in AS400?
  • How to find all libraries in AS400?
  • How to change the library list in AS400?
  • What is access path in AS400?
  • What is the difference between source physical file and physical file in as400?
  • how to find the source file of an object in as400?
  • how to change record length of source physical file in as400?
  • What is cpf4174 error in as400?
  • What is the use of varying keyword in rpgle?
  • What is DDS in AS400?
  • What is the difference between PF and LF in as400?
  • Why do we use CHGPF command in AS400?
  • how to create physical file in as400?
  • What are the data types supported by physical files in AS400?
  • how to add data in physical file in as400?
  • how to view journal entries in as400?
  • what is the use of ovrdbf in as400?
  • What is an array in AS400?
  • what is a data queue in as400 and why do we use data queue?
  • How to run stored procedure in AS400?
  • How to resolve session and device error in AS400?
  • how to check as400 system values?
  • How to check triggers on a file in as400?
  • How to find damaged objects in AS400?
  • what is module in as400?
  • How to create binding directory in as400?
  • how to create ifs folder in as400?
  • What is ASP in AS400?
  • What is JOBQ and how to create a JOBQ in AS400?
  • What is PSDS in AS400?
  • What is SEU in AS400 and why do we use it?
  • What is the multi-format logical file in AS400?
Leave an answer

Leave an answer
Cancel reply

Browse
Browse

Choose from here the video type.

Put Video ID here: https://www.youtube.com/watch?v=sdUUx5FdySs Ex: "sdUUx5FdySs".

 

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Admin
    Admin
    2024-10-06T19:08:03+05:30Added an answer on October 6, 2024 at 7:08 pm

    In this case, you are passing the timestamp value in character format to the %date built-in function which is incorrect. Try converting the timestamp value in character format to timestamp type and then pass it to the %date bif as a parameter that will work.

    This is the correct RPGLE source code converting timestamp to date and now you won’t encounter the error Date, Time or Timestamp value is not valid (C G D F).

          Ddate1            s               D 
           /free                              
            date1 = %date(%timestamp('2024-03-16-15.10.40.456465'));  
            return;
           /end-free 

    Line 3: Converting the ‘2024-03-16-15.10.40.456465' timestamp value in character type to timestamp type by using %timestamp bif i.e. %timestamp(‘2024-03-16-15.10.40.456465') and then pass this value to the %date bif as %date(%timestamp(‘2024-03-16-15.10.40.456465')). This will return the date as ‘2024-03-16’ out of the timestamp value in the date1 variable.

      • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp

Sidebar

Statistics

  • Questions 143
  • Answers 177
  • Comments 0
  • Popular
  • Answers
  • Admin

    Why do we use OVERLAY keyword in data structure subfields ...

    • 12 Answers
  • Admin

    How to call sql stored procedure with output parameter from ...

    • 6 Answers
  • Admin

    How to use declare global temporary table statement in RPGLE?

    • 5 Answers
  • Admin
    Admin added an answer CPF4131 is a record format level check error. This indicates… October 18, 2024 at 1:58 am
  • Admin
    Admin added an answer To open the command prompt with administrator rights you can… October 17, 2024 at 12:27 am
  • Admin
    Admin added an answer In AS400, "AS" stands for Application system. This article discusses… October 13, 2024 at 12:49 pm

Related Questions

  • Admin

    what is level check error and how to resolve level ...

    • 1 Answer
  • Admin

    What are AS400 systems. Please provide a introduction of AS400 ...

    • 1 Answer
  • Admin

    Is there any online server available for practicing on AS400 ...

    • 1 Answer
  • Admin

    What are the menus available in AS400?

    • 1 Answer
  • Admin

    What is subsystem in AS400?

    • 1 Answer

Trending Tags

.htaccess (1) as400 (123) bing-webmaster (2) control-language (12) db2 (33) ftp (8) google-adsense (1) google-search-console (3) https-redirect (1) iasp (4) ifs (22) jar (4) operations (3) php-my-admin (1) qshell (3) robots.txt (4) rpg (26) stored-procedure (3) stroed procedure (1) triggers (1) yoast (4)

Explore

  • Home
  • Categories
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags

Footer

BrainChime

BrainChime is a blog that posts question-and-answer-based format articles on diverse topics and engages in discussions by allowing people to provide answers/comments without the need to register and log in.

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Terms of Use
  • Privacy Policy
  • Cookie Policy

Help

  • FAQs
  • Categories
  • Tags

© 2024 BrainChime. All Rights Reserved
by BrainChime.

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.

      Notifications