I'm a first timer with RPG-IV and am trying to write a D-spec. I don't know what the source type should be... tried PF, DSPF, D, DS....

I try to compile the file and it gives me an error involving DDS.

Any advice would be great... if I knew what information I should give you I would but the only experience I've had in the past with structured programing is COBOL...

7 Years
Discussion Span
Last Post by jwmollman

Hi viziroth, this might be too late of a response but I'll give it a go anyway. I'm currently taking my second-level RPG IV class so I'll try to help you out here.

I think you're getting Data Description Specification (DDS) with Definition Specifications (D-Specs, a special area in an RPG ILE program used to define variables) confused with each other. Those D-Specs are used for creating variables in RPG programs, so when you mentioned Physical Files, Display Files, etc, I think you meant DDS.

If, possibly, you're having trouble creating variables in an RPG program, you can do it like this:

*.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8

 // Variable named TotalDue defined as a standalone variable.
 // This variable is 7 positions long with two decimal positions.
 // After that is the variable FullName with 25 character positions.
D TotalDue        S              7  2
D FullName        S             25

    // RPG IV program code goes here...

But if you meant the DDS files, this can all depend on what you're trying to create. For example, you might be trying to create a "screen" but calling the program source type a Physical File when it should be a Display File. That would certainly give you your error messages when you try to compile.

I can help you out some more if you need. I hope I helped somewhat. :)


yeah, I was wayy too used to working with cobol so I was trying to do it the same way I did it there. I figured out like a couple days later; I actually had 3 problems.

1. I was in the wrong column
2. I saved as the wrong file type
3. I had the wrong file name

We had to save the d-specs in a file separate from the code... it was a little strange. So I linked it to just like using an external file.


Oh, okay I see what you mean. Yes, that does seem a little different linking variables into a separate file, but I'm glad you figured it out!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.