IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Why there is extra Characters in the output?


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bhim_s

New User


Joined: 19 Sep 2006
Posts: 46
Location: Australia

PostPosted: Thu Jul 26, 2007 1:41 pm
Reply with quote

Hey Guys, Below is my test program it's working fine

Code:
TEST03: PROC OPTIONS(MAIN) REORDER;                               
/**/                                                             
DCL ( SUBSTR,                                                     
       DATE,                                                     
       PLIDUMP,                                                   
       TIME) BUILTIN;                                             
DCL SYSPRINT FILE OUTPUT STREAM PRINT;                           
DCL XDATE EXT ENTRY OPTIONS(ASM RETCODE INTER);                   
/**/                                                             
DCL BLKIN        FILE  INPUT RECORD ENV(FB RECSIZE(80) TOTAL);   
DCL BLKOT        FILE  OUTPUT RECORD ENV(FB RECSIZE(80) TOTAL);   
DCL EOF_BLKIN               BIT(1) ALIGNED   INIT('0'B);         
DCL WS_VAR                      CHAR (80) INIT ('');             
DCL DATE_PARS              PIC '99999';                           
DCL 1 WS_STR             BASED(ADDR(WS_VAR)),                     
        5  WS_BATCH                   CHAR (3),         
        5  FILLER1                    CHAR (1),         
        5  WS_DATE                    CHAR (8),         
        5  FILLER2                    CHAR(68) INIT ('');     
/**/                                                         
    ON ENDFILE (BLKIN) EOF_BLKIN = '1'B;                     
    ON ERROR SNAP                                             
    BEGIN;                                                   
      ON ERROR SYSTEM;                                           
      PUT SKIP DATA(BLKIN_IN);                               
    END;                                                     
        OPEN FILE (BLKIN) TITLE ('STEPIN');                   
        OPEN FILE (BLKOT) TITLE ('STEPOUT');                 
/**/                                                         
      FETCH XDATE;                                           
      READ FILE (BLKIN) INTO (WS_VAR);                       
                       
      SELECT (WS_BATCH);                                     
             WHEN ('B01')                                     
               DO;                                           
               WS_BATCH = 'B02';                                         
               CALL XDATE ('MMDDYYYY',WS_DATE,'PARSD',DATE_PARS); 
               DATE_PARS = DATE_PARS + 1;                     
               CALL XDATE ('PARSD',DATE_PARS,'MMDDYYYY',WS_DATE);
               END;                                           
          WHEN ('B02')                                       
               WS_BATCH = 'B01';                             
          OTHERWISE                                           
               PUT SKIP LIST ('INVALID BATCH NO.');           
   END;                                                       
   WRITE FILE (BLKOT) FROM (WS_VAR);                         
   /**/           
 END TEST03;


But I am getting some extra characters in the output. See the files below

Code:
 INPUT : B01 02292008


Code:
 OUTPUT : B02 02292008h.


I will really appreciate if any one can please explain why this is so and what should do to avoid these.

Thanks
Bhim
Back to top
View user's profile Send private message
anbesivam

New User


Joined: 22 Aug 2006
Posts: 5

PostPosted: Thu Jul 26, 2007 10:39 pm
Reply with quote

Hi bhim_s,

May be this is because of your XDATE assembler program. Did you checked your assembler program's return values separately ?
Back to top
View user's profile Send private message
bhim_s

New User


Joined: 19 Sep 2006
Posts: 46
Location: Australia

PostPosted: Fri Aug 31, 2007 7:30 pm
Reply with quote

got the solution when i Initialize filler2 with blanks after xdate call.

Code:

CALL XDATE ('PARSD',DATE_PARS,'MMDDYYYY',WS_DATE); 
FILLER2 = '';   
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts Build a record in output file and rep... DFSORT/ICETOOL 11
Search our Forums:

Back to Top