ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

O Spec trouble

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • O Spec trouble

    I'm doing assignments of Programming in RPG IV by Jim Buck, version 4. (Free format C specs, fixed everything else). And I'm trying to do this with O specs. My trouble is at line 1. I can't do it. The dates on the UDATE just keeps supressing the Zeroes. And the page number. I did set it to ' 0 ' I'm expecting it to be a 01 for page one instead of a suppressed 1.

    Program code:
    PHP Code:
    OFilename++DF..N01N02N03Excnam++++B++A++Sb+Sa+.............................Comments++++++++++++
    OQPRINT    E            Headings       2  1                                                    
    O
    ..............N01N02N03Field+++++++++YB.End++PConstant/editword/DTformat++Comments++++++++++++
    O                       UDATE                8 '  /  /  '                                      
    O                                          119 'Page'                                          
    O                       PAGE               124 '  0 ' 

    Output:
    Code:
    [FONT=lucida sans unicode]*...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+....0....+....1....+....2....+....3
     2/11/20                                                                                                           Page    1      [/FONT]
    Click image for larger version

Name:	tNLRbFk.png
Views:	221
Size:	117.1 KB
ID:	152406

  • #2
    The suppression of zeros happens up to and including where the zero is placed in the edit code.
    Code:
    OFilename++DF..N01N02N03Excnam++++B++A++Sb+Sa+.............................Comments++++++++++++
    OQPRINT    E            Headings       2  1                                                    
    O..............N01N02N03Field+++++++++YB.End++PConstant/editword/DTformat++Comments++++++++++++
    O                       UDATE                8 '0  /  /  '                                      
    O                                          119 'Page'                                          
    O                       PAGE               124 ' 0  '

    Comment


    • OLDMAN25
      OLDMAN25 commented
      Editing a comment
      Thanks! That makes a lot of sense

  • #3
    O-specs?! There must be a reason for not using externally described printer files...but I can't think of what that might be.

    Did a project moons ago to convert all of our remaining O-spec programs to external print file - JCR command JCRPRTF was extremely handy for that effort.

    Cheers,

    Emmanuel

    Comment


    • #4
      Consider using an edit code
      Code:
      [COLOR=#000000][COLOR=#0000BB]OQPRINT    E            Headings       2  1                                                    
      O[/COLOR][COLOR=#007700]..............[/COLOR][COLOR=#0000BB]N01N02N03Field[/COLOR][COLOR=#007700]+++++++++[/COLOR][COLOR=#0000BB]YB[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]End[/COLOR][COLOR=#007700]++[/COLOR][COLOR=#0000BB]PConstant[/COLOR][COLOR=#007700]/[/COLOR][COLOR=#0000BB]editword[/COLOR][COLOR=#007700]/[/COLOR][COLOR=#0000BB]DTformat[/COLOR][COLOR=#007700]++[/COLOR][COLOR=#0000BB]Comments[/COLOR][COLOR=#007700]++++++++++++[/COLOR]
      [COLOR=#0000BB]O                       UDATE         Y      8 [/COLOR]
      [/COLOR]

      Comment


      • #5
        Originally posted by EmmanuelW1 View Post
        O-specs?! There must be a reason for not using externally described printer files...but I can't think of what that might be.

        Did a project moons ago to convert all of our remaining O-spec programs to external print file - JCR command JCRPRTF was extremely handy for that effort.

        Cheers,

        Emmanuel
        No reason really. I'm just relearning everything I need to. Don't know when the time comes that I may need to support a project riddled with programs using I and O specs.

        Comment

        Working...
        X