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...

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
DName+++++++++++ETDsFrom+++To/Len+IDc.Keywords+++++++++++++++++++++++++++++

 // 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

 /Free
    // RPG IV program code goes here...
 /End-Free

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!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.