MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PLI syntax needed for report program

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
mfuser
Banned


Joined: 01 Mar 2005
Posts: 105
Topics: 58

PostPosted: Thu Dec 22, 2005 12:33 pm    Post subject: PLI syntax needed for report program Reply with quote

Hai All,

I am basically new to PLI programming and i need to generate a report which is 133 bytes and which might look like this:
I need to start my header lines from column 61

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+-----------------
********************************* Top of Data **********************************
                                                            PAGE    :          1
                                                            RUN DATE: 12/22/2005
                                                            RUN TIME:   10:10:10


I have coded in my program like this:

Code:

DCL 1 PAGELN,                                          /* PAGE NO */
      2 CC          CHAR (1)      INIT (' '),                       
      2 FILLER1     CHAR (60)     INIT (' '),                       
      2 FILLER2     CHAR (17)     INIT ('PAGE    :        '),       
      2 FILLER3     CHAR (03)     INIT ('  1'),                     
      2 FILLER4     CHAR (52)     INIT (' ');                       
                                                                     
DCL 1 DATELN,                                         /* RUN DATE */
      2 CC          CHAR (1)    INIT (' '),                         
      2 FILLER1     CHAR (60)   INIT (' ' ),                         
      2 FILLER2     CHAR (10)   INIT ('RUN DATE: '),                 
      2 DATESHOW    CHAR (10)   INIT ('  /  /    '),                 
      2 FILLER3     CHAR (52)   INIT (' ');                         
                                                                     
DCL 1 TIMELN,                                         /* RUN TIME */
      2 CC          CHAR (1)    INIT (' '),                         
      2 FILLER1     CHAR (60)   INIT (' '),                         
      2 FILLER2     CHAR (12)   INIT ('RUN TIME:   '),               
      2 TIMESHOW    CHAR (08)   INIT ('  :  :  '),                   
      2 FILLER3     CHAR (52)   INIT (' ');                         

DCL DATEA CHAR (6);
DCL TIMEA CHAR (6);

DATEA = DATE;
TIMEA = TIME;


SUBSTR(DATESHOW,1,2) = SUBSTR(DATEA,3,2);
SUBSTR(DATESHOW,4,2) = SUBSTR(DATEA,5,2);
SUBSTR(DATESHOW,9,2) = SUBSTR(DATEA,1,2);
SUBSTR(DATESHOW,7,2) = 20;             
SUBSTR(TIMESHOW,1,2) = SUBSTR(TIMEA,1,2);
SUBSTR(TIMESHOW,4,2) = SUBSTR(TIMEA,3,2);
SUBSTR(TIMESHOW,7,2) = SUBSTR(TIMEA,5,2);

PUT FILE (A) EDIT (PAGELN)  (SKIP(1), COL(60), A);
PUT FILE (A) EDIT (DATELN)  (SKIP(1), COL(60), A);
PUT FILE (A) EDIT (TIMELN)  (SKIP(1), COL(60), A);




Can anybody guide me if my usage of the PUT FILE Statement is correct as i am not able to acheive desired results ?
Back to top
View user's profile Send private message
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 316
Topics: 50
Location: Germany

PostPosted: Fri Dec 23, 2005 5:17 am    Post subject: Reply with quote

Hi mfuser,

1) do not use builtin functions DATE / TIME, use builtin function DATETIME, advantage: You get four digit year.

2) Code like this:

Code:

DCL PAGELN_C UNAL CHAR(133) BASED(ADDR(PAGELN));
DCL 1 PAGELN UNAL,                                     /* PAGE NO */
    2 CC          CHAR (1)      INIT (' '),
    2 FILLER1     CHAR (60)     INIT (' '),
    2 FILLER2     CHAR (17)     INIT ('PAGE    :        '),
    2 FILLER3     CHAR (03)     INIT ('  1'),
    2 FILLER4     CHAR (52)     INIT (' ');

DCL REPORT EXTERNAL FILE RECORD OUTPUT ;
OPEN FILE(REPORT);
WRITE FILE(REPORT) FROM(PAGELN_C);
CLOSE FILE (REPORT);



regards,
bauer
Back to top
View user's profile Send private message
mfuser
Banned


Joined: 01 Mar 2005
Posts: 105
Topics: 58

PostPosted: Fri Dec 23, 2005 9:13 am    Post subject: Reply with quote

Hai bauer,

Thanks for your hep .Basically in my program i have to use PUT FILE Syntax only as i cannot use WRITE FILE as per the requirements.If i were to acheive the same results using DATETIME Builtin and i have to keep track of the page nos for incrementing if the no of lines written to the file exceed 55 i have to once again write the headers with increasing page no like below.How can i achive my desired results ? Can you please guide me ahead ?


Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+
********************************* Top of Data **********************************
                                                            PAGE    :          1
                                                            RUN DATE: 12/22/2005
                                                            RUN TIME:   10:10:10


            ABC REPORT


RECORD
RECORD
.
.

.




----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+
********************************* Top of Data **********************************
                                                            PAGE    :          2
                                                            RUN DATE: 12/22/2005
                                                            RUN TIME:   10:10:10



            ABC REPORT



RECORD
RECORD
.
.
.

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group