× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Mike,
        Have any data structures or fields changed sizes in called programs?
I know that if called PGMS parameters are bigger than the callers then
caller fields can be overlain with called data that are not specified on a
parameter list.


Thank you,
Matt Tyler
Mattt@wincofoods.com

-----Original Message-----
From: Wills, Mike N. (TC) [mailto:MNWills@taylorcorp.com]
Sent: Monday, September 16, 2002 08:41
To: 'rpg400-l@midrange.com'
Subject: RE: URGENT! - Program Error

Joe,
Neither of those worked suggestions worked. Here is the source to my
program:

The subroutine I am having problems with is $CrtROC and the commented code
is what was added. The program bombs on this line in the subroutine:
     C                   Open      FTPSCRIPT


     H ACTGRP(*CALLER) BNDDIR('TAYBND') DFTACTGRP(*NO)

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
      * PROGRAM . . . . . CUGPRCSMON
      *
      * CREATED ON  . . . 03/29/2002
      *         BY  . . . Michael N. Wills
      *
      * DESCRIPTION . . . Process the request to create a PDF file from the
      *                   CUGMONPDFQ program

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
      * File for FTP Script
     F*FTPSCRIPT UF A E             DISK
     FFTPSCRIPT UF A E             DISK    USROPN

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
      * DataQ Fields
     D DataQTxt        S             76
     D DataQueue       DS
     D  Function                     10A
*SPOOL
     D  RecType                       2A
01
     D  JobName                      10A
Job Name
     D  JobUserName                  10A
Job User Name
     D  JobNumber                     6A
Job Number
     D  SplfName                     10A
Spool File Name
     D  SplfNumber                    8B 0
Spool File Number
     D  OutqName                     10A
Output Queue Name
     D  OutqLib                      10A
Output Queue Library

      * PDF Information
     D FileName        S             64
PDF File Name
     D DirName         S             64
     D Path            S            128
Path Name

      * Spool File Information
     D Length          S              4B 0 Inz(X'000005B8')
     D FormatName      S              8    Inz('SPLA0100')
     D JobID           S             16    Inz(*Blanks)
     D SplfID          S             16    Inz(*Blanks)
     D QJob            S             26
     D RecDS           DS
     D  Reciever               1   1464
     D   UsrDta               91    100A
     D   NumPgs              141    144B 0

      * Misc
     D Apos            C                   Const(X'7D')
     D PDFto           S              1
A = IFS

T = TCOFFICE

I = INDUS
     D SplfNumberNum   S              8  0
     D SplfNumberTxt   S              8
     D Temp            S              3
     D CmpnyNum        S              4  0
     D FNCmpny         S              4  0
     D FNReport        S             20
     D FNType          S              3
     D FNOther         S              6
     D ToOutQ          S             10
     D CleanUp         S              1    Inz('N')
Move the Splf flag
     D FTPLoc          S             15
Enter IP Address
     D BldFileName     S              1    Inz('Y')
Auto Build File Name

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
      * ILE Data Structures for service programs
      /COPY QSRVSRC,P.PDFMOD

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
      * Entry Parms
     C     *Entry        PList
     C                   Parm                    DataQTxt

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
      * MAIN

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
     C                   Eval      *INLR = *On

     C                   Eval      DataQueue = DataQTxt

     C                   Eval      SplfNumberNum = SplfNumber
     C                   Eval      SplfNumberTxt = %Char(SplfNumberNum)

     C                   ExSr      $RtvSplfA

      * Decide what spool file to process.
     C                   Select

     C                   When      (OutqName = 'LAWPDFF' or
     C                             OutqName = 'LAWPDFP') and
     C                             (%SubSt(SplfName:1:2) = 'BS' or
     C                             %SubSt(SplfName:1:2) = 'PL')
     C                   ExSr      $CrtBSPL

     C                   When      %SubSt(SplfName:1:3) = 'ROC'
     C                   ExSr      $CrtROC

     C                   When      %SubSt(SplfName:1:5) = 'AP175' or
     C                             %SubSt(SplfName:1:5) = 'AP260'
     C                   If        NumPgs > 1
     C                   ExSr      $CrtAP175
     C                   EndIf

     C                   When      %SubSt(SplfName:1:5) = 'AP170' or
     C                             %SubSt(SplfName:1:5) = 'AP190'
     C                   If        NumPgs > 1
     C                   ExSr      $CrtAP170
     C                   EndIf

     C*                  When      %SubSt(SplfName:1:5) = 'GL221'
     C*                  If        NumPgs > 1
     C*                  ExSr      $CrtGL221
     C*                  EndIf
      *
     C                   When      SplfName = 'CUTVENMAST'
     C                   ExSr      $CrtTC212

     C                   Other
     C                   Return

     C                   EndSl

      * Create the file name.
     C                   If        BldFileName = 'Y'
     C                   ExSr      $FileName
     C                   EndIf
     C                   Eval      BldFileName = 'Y'
      * Convert the spool file.
     C                   ExSr      $CvtSplf
      * Move the spool file.
     C                   ExSr      $CleanUp

     C                   Return

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
      * $FileName - Create the file name

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
     C     $FileName     BegSr

     C                   Eval      FileName = #BuildFile(FNCmpny :
     C                                                   FNReport:
     C                                                   FNType  :
     C                                                   FNOther )

     C                   EndSr

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
      * $CvtSplf - Convert the spoolfile

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
     C     $CvtSplf      BegSr

     C                   Select
     C                   When      PDFto = 'A'
     C                   Call      'CUCPDFIFS'
     C                   Parm                    SplfName
     C                   Parm                    JobName
     C                   Parm                    JobUserName
     C                   Parm                    JobNumber
     C                   Parm                    SplfNumberNum
     C                   Parm                    OutqName
     C                   Parm                    FileName
     C                   Parm                    DirName

     C                   When      PDFto = 'T' or PDFto = 'I'
     C                   Call      'CUCPDFFTP'
     C                   Parm                    SplfName
     C                   Parm                    JobName
     C                   Parm                    JobUserName
     C                   Parm                    JobNumber
     C                   Parm                    SplfNumberNum
     C                   Parm                    OutqName
     C                   Parm                    FileName
     C                   Parm                    DirName
     C                   Parm                    PDFto

     C                   When      PDFto = 'J'
     C                   Call      'CUCJAVAFTP'
     C                   Parm                    FTPLoc
     C                   EndSl

     C                   EndSr

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
      * $CleanUp - Move the spool file

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
     C     $CleanUp      BegSr

     C                   Select

     C                   When      CleanUp = 'M'
     C                   Call      'CUCMVSPLF'
     C                   Parm                    SplfName
     C                   Parm                    JobName
     C                   Parm                    JobUserName
     C                   Parm                    JobNumber
     C                   Parm                    SplfNumberNum
     C                   Parm                    ToOutQ

     C                   When      CleanUp = 'D'
     C                   Call      'CUCDLTSPLF'
     C                   Parm                    SplfName
     C                   Parm                    JobName
     C                   Parm                    JobUserName
     C                   Parm                    JobNumber
     C                   Parm                    SplfNumberNum

     C                   EndSl

     C                   EndSr

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
      * $RtvSplfA - Retrieve the spool file attributes

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
     C     $RtvSplfA     BegSr

     C                   Eval      QJob = JobName + JobUserName +
     C                                    JobNumber

     C                   Call      'QUSRSPLA'
     C                   Parm                    Reciever
     C                   Parm                    Length
     C                   Parm                    FormatName
     C                   Parm                    QJob
     C                   Parm                    JobID
     C                   Parm                    SplfID
     C                   Parm                    SplfName
     C                   Parm                    SplfNumber

     C                   EndSr

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
      * $CrtBSPL - Process for Financial Reports

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
     C     $CrtBSPL      BegSr


     C                   Eval      Temp = %SubSt(JobName:3:3)
     C                   Move      Temp          CmpnyNum

      * Build the directory
     C                   Eval      DirName = %Trim(#GetDirInfo(CmpnyNum)) +
     C                                       '_FINSTMTS/'

     C                   Select
     C                   When      %SubSt(OutQName:7:1) = 'P'
     C                   Eval      DirName = %Trim(DirName) + 'Prelim/'
     C                   When      %SubSt(OutQName:7:1) = 'F'
     C                   Eval      DirName = %Trim(DirName) + 'Final/'
     C                   EndSl

      * Set up job attributes
     C                   Eval      BldFileName = 'Y'
     C                   Eval      FNCmpny  = CmpnyNum
     C                   Eval      FNReport = %SubSt(SplfName:1:
     C                                        %Len(%TrimR(SplfName)) - 1)
     C                   Eval      FNType   = 'PDF'
     C                   Eval      FNOther  = ' '

     C                   Eval      PDFto    = 'I'
     C                   Eval      ToOutQ   = 'LAWPDFBKUP'
     C                   Eval      CleanUp = 'M'

     C                   EndSr

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
      * $CrtAP175 - Create the AP175 & AP260 PDF files

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
     C     $CrtAP175     BegSr

     C                   Eval      Temp = %SubSt(JobName:6:3)
     C                   Move      Temp          CmpnyNum

      * Set up job attributes
     C                   Eval      BldFileName = 'Y'
     C                   Eval      FNCmpny  = CmpnyNum
     C                   Eval      FNReport = %SubSt(SplfName:1:5)
     C                   Eval      FNType   = 'PDF'
     C                   Eval      FNOther  = ' '

      * Create the file name.
     C                   ExSr      $FileName
      * Save a copy on the IFS
      * Build the directory
     C                   Eval      DirName = %SubSt(SplfName:1:5)
     C                   Eval      PDFto    = 'A'
      * Convert the spool file.
     C                   ExSr      $CvtSplf

      * Save to Indus
      * Build the directory
     C                   Eval      DirName = %Trim(#GetDirInfo(CmpnyNum)) +
     C                                       '_' + %SubSt(SplfName:1:5)
     C                   Eval      PDFto    = 'I'
     C                   Eval      ToOutQ   = '          '
     C                   Eval      CleanUp  = ' '

     C                   EndSr

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
      * $CrtAP170 - Create the AP170 & AP190 PDF files

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
     C     $CrtAP170     BegSr

     C                   Eval      Temp = %SubSt(JobName:6:3)
     C                   Move      Temp          CmpnyNum

      * Build the directory
     C                   Eval      DirName = %Trim(#GetDirInfo(CmpnyNum)) +
     C                                       '_' + %SubSt(SplfName:1:5)

      * Set up job attributes
     C                   Eval      BldFileName = 'Y'
     C                   Eval      FNCmpny  = CmpnyNum
     C                   Eval      FNReport = %SubSt(SplfName:1:5)
     C                   Eval      FNType   = 'PDF'
     C                   Eval      FNOther  = ' '

     C                   Eval      PDFto    = 'A'
     C                   Eval      ToOutQ   = '          '
     C                   Eval      CleanUp  = ' '

     C                   EndSr

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
      * $CrtROC - Create the ROC files

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
     C     $CrtROC       BegSr

     C                   Eval      Temp = %SubSt(JobName:3:3)
     C                   Move      Temp          CmpnyNum

      * Build the directory
     C                   Eval      DirName = %Trim(#GetDirInfo(CmpnyNum)) +
     C                                       '_FINSTMTS/FINAL'
      * Set up job attributes
     C                   Eval      BldFileName = 'Y'
     C*                  Eval      FTPLoc = '172.25.6.213'
     C                   Eval      FTPLoc = '172.25.9.23'
     C                   Eval      FNCmpny  = CmpnyNum
     C                   Eval      FNReport = %SubSt(SplfName:1:3)
     C                   Eval      FNType   = 'HTM'
     C                   Eval      FNOther  = ' '

     C                   Eval      PDFto    = 'J'
     C                   Eval      ToOutQ   = 'LAWPDFBKUP'
     C                   Eval      CleanUp  = 'M'

      * Create the FTP Script
     C                   ExSr      $FileName

     C                   Open      FTPSCRIPT

     C                   Eval      FTPTEXT = 'as400 pass4400'
     C                   Write     FTPFMT
     C                   Eval      FTPTEXT = 'quote site exec rock.bat ' +
     C                                       %Trim(SplfName) + ' ' +
     C                                       %Trim(%Char(SplfNumberNum)) + '
' +
     C                                       %Trim(JobName) + ' ' +
     C                                       %Trim(JobUserName) + ' ' +
     C                                       %Trim(JobNumber) + ' ' +
     C                                       %Trim(DirName) + '/' +
     C                                       %Trim(FileName)
     C                   Write     FTPFMT
     C                   Eval      FTPTEXT = 'quit'
     C                   Write     FTPFMT

     C                   Close     FTPSCRIPT

     C                   Call      'CUCCLRPF'
     C                   Parm      'FTPSCRIPT'   File             10
     C                   Parm      'PDFPGMS'     Lib              10

     C                   EndSr

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
      * $CrtTC212 - Create the TC212 PDF files

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
     C     $CrtTC212     BegSr

     C                   Eval      Temp = %SubSt(JobName:6:3)
     C                   Move      Temp          CmpnyNum

     C                   Move      SplfNumber    SplfNumberTxt

      * Set up job attributes
     C                   Call      'CUCSTC212'
     C                   Parm                    JobName
     C                   Parm                    JobUserName
     C                   Parm                    JobNumber
     C                   Parm                    SplfNumberTxt

     C                   Eval      BldFileName = 'N'
     C                   Eval      PDFto = ' '
      * Build the directory
     C                   Eval      ToOutQ   = 'AP175OUTQ '
     C                   Eval      CleanUp  = 'M'

     C                   EndSr

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
      * $CrtGL221 - Create the GL221 PDF files

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
     C*    $CrtGL221     BegSr
      *
     C*                  Eval      Temp = %SubSt(JobName:6:3)
     C*                  Move      Temp          CmpnyNum
      *
      * Build the directory
     C*                  Eval      DirName = %Trim(#GetDirInfo(CmpnyNum)) +
     C*                                      '_' + %SubSt(SplfName:1:5)
      *
      * Set up job attributes
     C*                  Eval      BldFileName = 'Y'
     C*                  Eval      FNCmpny  = CmpnyNum
     C*                  Eval      FNReport = %SubSt(SplfName:1:5)
     C*                  Eval      FNType   = 'PDF'
     C*                  Eval      FNOther  = ' '
      *
     C*                  Eval      PDFto    = 'I'
     C*                  Eval      ToOutQ   = 'GLDELTOUTQ'
     C*                  Eval      CleanUp  = 'M'
      *
     C*                  EndSr
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.