H Spec

5 pts.
Tags:
RPGLE
Dear All !! Q1. Can we define the compile option - debugging view (DBGVIEW) = *all in H spec ??? If yes, please let me know the syntax. Q2. How do we retrieve system date in RPG or RPG IV ? [Note : *date or Udate retrieves the job date] Thanks and regards, Kalpesh
ASKED: May 17, 2006  7:22 AM
UPDATED: November 23, 2010  2:56 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Q1-Unfortunately there is not an h-spec compile directive for this. Your best bet is to use the CHGCMDDFT command to force this parameter to *ALL on the command you will be using. The best thing to do is create a duplicate of this command with the same name in a library that is in front of QSYS in your system library list and modify this.

Q2-Use the %DATE built in function which is only available in ILE RPG. An ‘EVAL date_field = %DATE()’ will load date_field with the current system date.

Discuss This Question: 8  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Uppikal
    Thanks very much for the %DATE solution !!! but what I ment by H-Spec is the control specification declaration spec in RPG. e.g. ... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... HOPTION (*NODEBUGIO) so, now while compiling the program we need not define *nodebugio. This declaration will take care off.. Similarly can we declare for dbgview ?? Thanks and regards, Kalpesh
    5 pointsBadges:
    report
  • EDI4Colorado
    No, you cannot code a control spec so that it compiles as debug *yes.
    0 pointsBadges:
    report
  • Geneburns
    Q1. Can we define the compile option - debugging view (DBGVIEW) = *all in H spec ??? Would this be what your are looking for? OPTION(*SRCSTMT) If *SRCSTMT is specified, statement numbers for the listing are generated from the source ID and SEU sequence numbers as follows: stmt_num = source_ID * 1000000 + source_SEU_sequence_number For example, the main source member has a source ID of 0. If the first line in the source file has sequence number 000100, then the statement number for this specification would be 100. A line from a /COPY file member with source ID 27 and source sequence number 000100 would have statement number 27000100. *NOSRCSTMT indicates that line numbers are assigned sequentially.
    15 pointsBadges:
    report
  • TomLiotta
    DBGVIEW() is an option for the system debugger, not a RPG option. DBGVIEW() isn't specific to a given programming language. Debug options in RPG source code are more directed to support supplied by the RPG compiler rather than by the system itself. If the options were available in source code, how would you expect the command parameter to work? If the command parameter said *LIST and program source said *NONE, which would you expect to have precedence? BTW, please don't ask two unrelated questions in a single post. It makes it extremely difficult for others who come later to search for useful answers. Tom
    125,585 pointsBadges:
    report
  • Teandy
    My question would be, why not just do as WaltZ400 said and just change the command default to something like this?
    
    CHGCMDDFT  CMD(CRTBNDRPG) NEWDFT('DBGVIEW(*ALL) 
    
    
    5,860 pointsBadges:
    report
  • TomLiotta
    why not just do as WaltZ400 said and just change the command default... Because an H-spec affects a specific program permanently (until the H-spec is changed). Changing a command default affects every program compiled from then on, and upgrades or PTFs can remove the changed default. When you want a specific program to have options, it doesn't make much sense to set every other program the same way. Tom
    125,585 pointsBadges:
    report
  • graybeard52
    You can add a default H spec with various options, depending what you need. For example if you put
    Option(*SRCSTMT:*NODEBUGIO:*XREF) 
    in the data area QRPGLE/DFTLEHSPEC this H-spec will get included in every RPGLE compile, unless the H-spec is specfically included.
    3,115 pointsBadges:
    report
  • TomLiotta
    You can add a default H spec with various options... True. Unfortunately none of the options will set the compiler DBGVIEW() parameter. And I haven't quite come up with a good reason for having it done. It doesn't seem to me to be useful for individual programs when the command can be used as needed. Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following