RPGILE compiler says

100 pts.
Tags:
AS/400
AS/400 compile
Hi! Compiler says this for a WORKSTN file:
    391 OFMGESTION E            FGEST1                                                                  
    392 O***********                                                                                    
         *--------------------------------------------------------------------------------------------* 
         * Formato record RPG . . . . :  FMGESTION                                                    * 
         * Formato esterno  . . . . . :  FMGESTION : ARGASOFT1/PROVINFMT                              * 
         *--------------------------------------------------------------------------------------------* 
    393=O*(NOTOUT)              NOTIZ               70A CHAR       70                                   
    394=O*(NOTOUT)              PVNCHIAVE           72A CHAR        2                                   
    395=O*(NOTOUT)              PVNDESCRI          102A CHAR       30                                   
    396=O*(NOTOUT)              PVNCAPFM           108A CHAR        6                                   
    397=O*(NOTOUT)              PVNCAPTO           114A CHAR        6                                   
    398=O*(NOTOUT)              PVNCAPOLUO         144A CHAR       30
This is part of the DDS for the file with                                      REF(ARGASOFT1/CODPROVINC CODPROVREC)
0010.50      A          R FMGESTION                                                          
0010.60      A*%%TS  SD  20131208  193820  ARGASOFT    REL-V5R3M0  5722-WDS                  
0010.70      A                                      CF03                                     
0010.80      A                                      CF10                                     
0010.90      A* 99                                  OVERLAY                                  
0011.00      A                                  1 32'GESTIONE PROVINCE'                      
0011.10      A                                  1 65'© argasoft elba'                        
0011.20      A            NOTIZ         70   O  3  6COLOR(RED)                               
0011.30      A                                  5 25'inserire i dati in tutti i campi'       
0011.40      A                                      COLOR(YLW)                               
0011.50      A                                  7 17'sigla ...........'                      
0011.60      A            PVNCHIAVE R    2A  B  7 35                                         
0011.70      A  30                                  DSPATR(PC)                               
0011.80      A N30                                  COLOR(TRQ)                               
0011.90      A  30                                  COLOR(RED)                               
0012.00      A                                  9 17'denominazione ...'                      
0012.10      A            PVNDESCRI R   30A  B  9 35                                         
0012.20      A  31                                  DSPATR(PC)                               
0012.30      A N31                                  COLOR(TRQ)                               
0012.40      A  31                                  COLOR(RED)
Both compiled with no errors. Program called w/out errors. Debugged and it does what I want except that there is no output in the displayed fields. I do not use EXFMT command as I use subroutines to check inut validity and want to output with error indicator on (i.e. 30, 31...) and position the cursor on the error field. I do a READ operation in the "main part" of the program. What's wrong?

 TIA and all the best for 2014. Arnaldo

Answer Wiki

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

Discuss This Question: 16  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
  • TomLiotta

    You haven't listed any fields under the exception 'O'-spec. With no fields listed, there are no fields assigned to receive values. That is, all of the fields are "not output". If you have 'O'-specs for an externally-described file, only fields named in the 'O'-spec group are output.

    I've never seen anyone use EXCEPT for a display file. It doesn't seem to make much sense. A WRITE op-code would seem to be a better choice, and no 'O'-spec should be in the source.

    Tom

    125,585 pointsBadges:
    report
  • argasoft
    Hi and thanks a lot.

    I know my question can be silly, but after a 15 years stop from S36 programming, I try to become acquainted with ILE etc. So I thought that having external defined files it would just populate the fields with their value at EXCEPT time without having to declare them in the 'O'-spec.
    I thought that WRITE was only for DISK or PRINTER files because, as said in IBM's ILE Reference Guide, it writes a new record to a file.
    I'll try also to understand why, although red colour and position cursor are ON (debug tested), the field remains in the original turquoise.

    Thanks again.
    Arnaldo
    100 pointsBadges:
    report
  • philpl1jb

    Most unusual .. I don't follow your logic for not using EXFMT ..

    Typically we use an EXFMT (which writes and reads) and then validate .. if not valid turn on the indicators (in your case 30 or 31) and exfmt again until valid.

    Without a write or an Exfmt there will be no output to the screen...

    But we suspect that you've found another way (EXCEPT -- or did Tom invent that).

    Phil

    49,720 pointsBadges:
    report
  • philpl1jb

    Arnaldo
    Didn't see your comment until after I posted.

    You compile the display file then the RPGLE

    In the RPG file you define the display

    FMyDSP    CF     E     WORKSTN

    Like the physical/logical files the rpg compiler will get the display record descriptions from the compiled display file.

    Then as I described use EXFMT

    Maybe in a loop like this

     

    EXFMT MyDSPRec

    Exsr Validate

    Dow Not Valid

    EXFMT MyDSPRec

    Exsr Validate

    ENDDO

    49,720 pointsBadges:
    report
  • philpl1jb

    Maybe a copy of Programming in RPG IV by Yaeger or Meyers & Yeager.

    Would save you a lot of time.  from $11.67 used @ Amazon

     

    49,720 pointsBadges:
    report
  • TomLiotta

    @Phil:

    The 'O'-spec in the questionshows FMGESTION as an EXCEPT line named FGEST1. And the '(NOTOUT)' is the EXCEPT output of the compiler for an EXCEPT record field that is "not output". Unfortunately, the behavior is only indirectly documented (AFAIK).

    @argasoft:

    Usually, externally-described files don't need fields coded for input or output. But because you actually coded an 'O'-spec (which normally wouldn't be coded at all), you're telling the compiler that you will do the output yourself.

    The documentation for the usage of EXCEPT says that an 'O'-spec with no fields can be used for an "unlock" operation. That's the only mention that I know of for no coded fields.

    Tom

    125,585 pointsBadges:
    report
  • argasoft
    Thanks again to all.

    @Tom:
    I also know from my RPGII years that EXCEPT and 'O'-spec with no fields unlocks a file.

    @Phil:
    I normally use this:

    EXCEPT FMT01
    TAG CYCLE
    READ WRKSTN-file
    KC GOTO ENDPGM
    01 EXSR CHECKFMT01
    02 EXSR CHECKFMT02
    ...
    ...
    ...
    NLR (or other indicator) GOTO CYCLE
    TAG ENDPGM
    SETON LR
    -----
    CKFMT01 BEGSR

    if OK either EXSR DSPFMT02 (if values for this have to be set-up) or EXCEPT FMT02

    ENDSR

    I find it somehow more readable. I have always used a lot of indicators as I had put up a sort of standard (01-09 for displays, 10 validity check OK, 50 for CHAIN, 90 for READ, from 30 for HI and PC in case of errors).

    But the real problems are that after checking and with errors present DSPF is shown but:
    - error fields not red coloured (see DDS)
    - incorrect PC

    Of course I use the right indicators in ILE and they are on (checked with a "home-made" debug, i.e. printing *INs and field values at different points of the program.

    I hope it's understandable and clear.

    TIA a lot.

    Arnaldo

    P.S. In case I can give a link to download pdfs of ILE-source and PF and DSPF DDSs
    100 pointsBadges:
    report
  • TomLiotta

    But the real problems are...

    Are there still problems after fixing your 'O'-specs?

    Tom

    125,585 pointsBadges:
    report
  • argasoft
    Hi Tom!

    Gonna change this morning (I'm on the other side of the ocean) and let you know.
    By the way I've downloaded some IBM manuals and others for CL (which replaces the god ol' OCL on S36) but do you know if there is some book that shows equivalents (WITH examples) between OCL and CL?

    I mean something like:
    // LOAD PGM
    // FILE NAME-XXX, LABEL-YYY, etc
    etc

    becomes
    call pgm
    ???

    I already know that with external defined files CALL PGM command is enough.

    Thanks again a lot.
    Arnaldo
    100 pointsBadges:
    report
  • TomLiotta

    Up until 15 years ago, there was a Redbook titled 'Converting System/36 environment applications to Native' (GG24-3304-01). It seems to have been discontinued some time before then. I have one or two very old REDbook CDs stashed somewhere around here. If I run across one, I'll see if I can extract that Redbook from it.

    But one problem with it is that it described converting to an AS/400 environment that was more than 20 years ago. Things have changed a lot since that manual was first written back in 1990 (I think). Even RPG III is effectively gone in current releases. (It can still be purchased, but it's now an extra cost option as is RPG II.)

    There is still a cross-reference list of OCL-to-CL commands available. It's an old .PDF you can download. See the V4R5 System Programming Support page and look down for 'System/36-AS/400 Command Cross-Reference: SX41-3732'. There is also a HTML link, and that works much better for me. It's not a particularly useful manual in the first place.

    Mostly there are just a few concepts that need to be grasped. Maybe your best direction is simply to ask a few questions. Find a couple OCL procs that don't seem to have a good match to CL, post them and ask how they should be done. Discussion can cover the underlying designs that could help explain the useful concepts.

    Anyway, if I find the Redbook CD, I'll see if anything can be done with it.

    Tom

    125,585 pointsBadges:
    report
  • argasoft
    Hi Tom.

    Thanks, first of all.

    I've already the one you suggest, but it's not very useful.
    I think I have to:
    - write a CL program
    - herein the CL equivalents to OCLs
    - compile the CL
    - at menu option write CALL CL-program-name

    Am I right?

    Arnaldo
    100 pointsBadges:
    report
  • philpl1jb

    What are you doing? 

    Converting S36 code or learning to write RPG IV by todays "standards"?

    49,720 pointsBadges:
    report
  • argasoft
    Hi Phil.

    Approaching actual RPGILE/CL after many years of developing on S36 (RPGII and OCL up to SSP 7.0) and a stop of about 15 years.
    I cannot use S36 environment as my 400 host provider: they told me it's not active due to security reasons.
    Anyway to learn something new.

    Arnaldo

    100 pointsBadges:
    report
  • philpl1jb

    Thants.

    Then some advise on AS/400 programming.

    O-specs and a display file, really odd and given any choice not the way to go. 

    Your display file looks good.  You've compiled it.

    Now the program.  drop the o specs.

    Goto's and Tags are generally not used.

    Loops are made with DoW or DoU (dowhile or do Until)   ... enddo

    Screen Records are executed with EXFMT (which does a write and read)

    Indicators, especially indicator controled C specs are used rarely, but indicators are a simple way to control the display file.

    Once compiled you can call a program from the command line or from a CL program.

    That would be:   CALL MyProgram

    The requirement is that the program, datafiles and display file are in the library list.

    49,720 pointsBadges:
    report
  • TomLiotta

    @Arnaldo:

    Yes, you compile CL programs and CALL them just like you call any program. You can also compile CL modules and bind them with RPG to make a single program that consists of both languages. A CL module could be called something like the way that a subroutine is executed.

    Tom

    125,585 pointsBadges:
    report
  • argasoft
    Thank a lot for your help.

    Arnaldo
    100 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