Solved

ERROR RNF0257 :Form-Type entry for main procedure not valid or out of  sequence.

Posted on 2016-10-17
3
38 Views
Last Modified: 2016-11-19
Hi,
I'm a beginner in AS-400. I was just trying out this code to understand the concept behind compile time  array . However, every time I compile my code I get
 ERROR RNF0257 :Form-Type entry for main procedure not valid or out of  sequence for the below lines
**CTDARA DARR1                                      
   JANUARY;                                    
  FEBRUARY;                                        
  MARCH;                                            
  APRIL;                                            
  MAY;                                              
  JUNE;                                            
  JULY;                                            
  AUGUST;                                          
  SEPTEMBER;                                        
  OCTOBER;                                          
  NOVEMBER;                                        
  DECEMBER;

The entire code is :
DDARR1            S             10A   DIM(6) CTDATA PERRCD(1)          
DN                     S               2P 0 INZ(1)                            
DMONTH          S             10A                                    
C                   DOW       N=6                                      
C                   EVAL      MONTH=DARR1(N)                            
C     MONTH         DSPLY                                              
C                   EVAL      N = N+1                                  
C                   ENDDO                                              
C                   SETON                                            LR
**CTDARA DARR1                                      
   JANUARY;                                    
  FEBRUARY;                                        
  MARCH;                                            
  APRIL;                                            
  MAY;                                              
  JUNE;                                            
  JULY;                                            
  AUGUST;                                          
  SEPTEMBER;                                        
  OCTOBER;                                          
  NOVEMBER;                                        
  DECEMBER;
0
Comment
Question by:EVE SAWYER
  • 3
3 Comments
 
LVL 27

Assisted Solution

by:tliotta
tliotta earned 500 total points (awarded by participants)
ID: 41846425
Since the source is not formatted using the {code} option, it can't be certain. But first requirement is that the "**CTDATA" record and the data records begin in position 1. And second, you're showing a "**CTDA R A" record and not "**CTDATA".
0
 
LVL 27

Accepted Solution

by:
tliotta earned 500 total points (awarded by participants)
ID: 41867284
To clarify, this version compiles successfully:
     DDARR1            S             10A   DIM(12) CTDATA PERRCD(1)
     DN                S              2P 0 INZ(1)
     DMONTH            S             10A
     C                   DOW       N=6
     C                   EVAL      MONTH=DARR1(N)
     C     MONTH         DSPLY
     C                   EVAL      N = N+1
     C                   ENDDO
     C                   SETON                                            LR
**CTDATA DARR1
JANUARY;
FEBRUARY;
MARCH;
APRIL;
MAY;
JUNE;
JULY;
AUGUST;
SEPTEMBER;
OCTOBER;
NOVEMBER;
DECEMBER;

Open in new window

It won't actually do anything, though, due to logic errors (and one or two additional bugs).

First logic error is that the DOW (doWhile) loop is testing for N=6. Since N is initialized to 1, the test will never be true. It should either have a DOU (doUntil) or the test should be N<6 (or some appropriate value.

The DIM() for DARRA1 also needs to be 12 since 12 array values were listed. (Extra values could be removed, but that doesn't seem likely.)
0
 
LVL 27

Expert Comment

by:tliotta
ID: 41894052
Corrected code that compiles without error clarifies simple descriptive comments about what caused errors.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Error with EIM Configuration on iSeries 8 733
CWBX .NET Message Queue 9 336
debugger with zend php iseries 3 230
Configure e-mail alerts VMWare Esxi 5.5 on IBM x3650 Server 6 142
The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
The advancement in technology has been a great source of betterment and empowerment for the human race, Nevertheless, this is not to say that technology doesn’t have any problems. We are bombarded with constant distractions, whether as an overload o…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question