ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Physical File to TEXT File

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

  • Physical File to TEXT File

    Hi

    Any1 know any APT for converting Physical file to Text File?

    thanks

  • #2
    Re: Physical File to TEXT File

    TXT format not expoting/
    thanks

    Comment


    • #3
      Re: Physical File to TEXT File

      What do u mean by text file? A file with .txt extension?

      How should the data be within this file? Tab Delimited, comman delimited, pipe delimited, etc?

      Comment


      • #4
        Re: Physical File to TEXT File

        I just want to change the attribute from pf-dtato txt.

        Comment


        • #5
          Re: Physical File to TEXT File

          Could you please explain, why you want to convert a physical file into a text file and not exporting it.

          Birgitta

          Comment


          • #6
            Re: Physical File to TEXT File

            i generate bunch of sql statments in the Physical file, and wish to run wit CL.
            But the SQL file must be in TXT format, but now in PF-DTA.

            Thanks

            Comment


            • #7
              Re: Physical File to TEXT File

              Hmmm, using CL may not be the best solution for what you want to do!
              Why not using embedded SQL in RPG???

              Code:
               /Free
                   Exec SQL Declare CsrC01 Cursor For
                              Select MySqlStmt from MyTable
                              where ....;
              
                   Exec SQL Open CsrC01;
              
                   DoU 1=0;
                       Exec SQL Fetch Next From CsrC01 into :StringSQLCmd;
                       If SQLCOD = 100;  //Last Row
                          Leave;
                       ElseIf SQLCOD < *Zeros; //Error
                          //Handle Error;
                          Iter;
                       EndIf;
                       
                       Exec SQL Execute Immediate :StringSQLCmd;
                       If SQLCOD < *Zeros; //Error
                          //Handle Error
                       EndIf;
                   EndDo;
              
                   Exec SQL Close CsrC01;
                   *INLR = *ON;
               /End-Free
              Birgitta
              Last edited by B.Hauser; July 18, 2011, 02:06 AM.

              Comment


              • #8
                Re: Physical File to TEXT File

                Why not output/copy the statements to a source file and use RUNSQLSTM in the CL program?

                Comment


                • #9
                  Re: Physical File to TEXT File

                  the story is like this..
                  I have used 1 SQL statement to generate 100 SQL statement and wish these 76 sql statments run by RUNSQLSTM.
                  But those 100 statements are now save in PF-DTA, but not TXT.
                  Therefore I have to first convert them to TST before execute by RUNSQLSTM.
                  Cheers ~~

                  Comment


                  • #10
                    Re: Physical File to TEXT File

                    cant you just use CPYTOIMPF or CPYTOSTMF?
                    PHP Code:

                    CPYTOIMPF FROMFILE
                    (LBIFIL/ARACUST)
                    TOSTMF('/home/flanary/cust.txt'MBROPT(*REPLACE)   
                    STMFCCSID(*PCASCIIRCDDLM(*CRLFDTAFMT(*FIXED)    
                    STRDLM(*NONEFLDDLM(*TAB

                    jamie
                    All my answers were extracted from the "Big Dummy's Guide to the As400"
                    and I take no responsibility for any of them.

                    www.code400.com

                    Comment


                    • #11
                      Re: Physical File to TEXT File

                      what he said /\
                      Michael Catalani
                      IS Director, eCommerce & Web Development
                      Acceptance Insurance Corporation
                      www.AcceptanceInsurance.com
                      www.ProvatoSys.com

                      Comment


                      • #12
                        Re: Physical File to TEXT File

                        You want them to be in a PF-SRC file instead of a PF-DTA file. How did they get in there in the first place? If you had a program write them to a data file, you should change the code to write them to a source file instead. Then you can run them.
                        "Time passes, but sometimes it beats the <crap> out of you as it goes."

                        Comment


                        • #13
                          Re: Physical File to TEXT File

                          you could create a source member in a source file then use SQL to move the statements:
                          Code:
                          insert into mysrcfile (select 0,0,data from theoriginalfile)
                          I'm not anti-social, I just don't like people -Tommy Holden

                          Comment


                          • #14
                            Re: Physical File to TEXT File

                            Why not just override your original program that creates the file to write to the file you want it in?

                            Comment

                            Working...
                            X