Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Problem with Date in the Trailer record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
pullaiah.cts

New User


Joined: 02 Sep 2010
Posts: 50
Location: Pune

PostPosted: Mon Jan 02, 2012 2:24 pm    Post subject: Problem with Date in the Trailer record
Reply with quote

Code:


01 OUT-PRICE-FLE-REC.                               
       05  OUT-CUSIP-VALUE         PIC X(9).       
       05  WS-DELIM                PIC X VALUE '|'.
       05  OUT-CUSIP-PRICE         PIC 9(10).9(8). 
       05  FILLER                  PIC X(10).
 
 
01  WS-TRL-REC.                                               
       05  WS-SOURCE-NAME    PIC X(2) VALUE 'MF'.             
       05  WS-DELIM          PIC X VALUE ','.                 
       05  WS-SOURCE-NAME    PIC X(3) VALUE 'PTS'.           
       05  WS-DELIM          PIC X VALUE ','.                 
       05  WS-EXEC-DATE.                                     
          10  WS-YEAR        PIC 9(04).         
          10  FILLER         PIC X(01) VALUE '-'.
          10  WS-MONTH       PIC 9(02).         
          10  FILLER         PIC X(01) VALUE '-'.
          10  WS-DATE        PIC 9(02).         
       05  WS-DELIM          PIC X VALUE ','.                 
       05  WS-TOT-REC        PIC 9(15).                       
 
MOVE WS-TRL-REC TO OUT-PRICE-FLE-REC.
WRITE OUT-PRICE-FLE-REC.


Output file: PS with record length 39

Code:

459745ABC|0000000101.50000009   
629377MNO|0000000100.25000000   
MF,PTS,    -  -  ,000000000000010


First 2 records are data records and last record is trailer record.
My problem is,when I am moving current date to output file I am getting only hyphens.It's not dislaying year,month and date values in the output file.
Can you please let me know whay I am getting like this?

Thanks in advance.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Jan 02, 2012 2:37 pm    Post subject: Reply to: Problem with Date in the Trailer record
Reply with quote

You haven't shown any code which is moving anything to the date fields. This may be the reason (because you don't have any code to do it). If it is not, we have not idea because you haven't shown your code.

Why two data records but count of 10? All thos WS-DELIMs might confuse. Different values for the delimiters might confuse, but if that is what the receiver of the file wants, so bet it.
Back to top
View user's profile Send private message
pullaiah.cts

New User


Joined: 02 Sep 2010
Posts: 50
Location: Pune

PostPosted: Mon Jan 02, 2012 2:44 pm    Post subject: Reply to: Problem with Date in the Trailer record
Reply with quote

Hi Bill,

Here is the code for Date varaible:

Code:

05  WS-EXEC-DATE.                                     
   10  WS-YEAR                     PIC 9(04).         
   10  FILLER                      PIC X(01) VALUE '-'.
   10  WS-MONTH                    PIC 9(02).         
   10  FILLER                      PIC X(01) VALUE '-'.
   10  WS-DATE                     PIC 9(02).   

01  WS-SYS-DATE.                             
    05  WS-SYS-CCYY                 PIC 9(04).
    05  WS-SYS-MM                   PIC 9(02).
    05  WS-SYS-DD                   PIC 9(02).

ACCEPT WS-SYS-DATE FROM DATE YYYYMMDD.   
MOVE CORR WS-SYS-DATE TO WS-SYS-DATE-DB2.
ACCEPT WS-SYS-TIME-6 FROM TIME.
MOVE CORR WS-SYS-TIME-6 TO WS-SYS-TIME.
         
MOVE  WS-SYS-DATE-DB2 TO WS-EXEC-DATE.
MOVE WS-TRL-REC TO OUT-PRICE-FLE-REC.
WRITE OUT-PRICE-FLE-REC.             
       
Back to top
View user's profile Send private message
pullaiah.cts

New User


Joined: 02 Sep 2010
Posts: 50
Location: Pune

PostPosted: Mon Jan 02, 2012 2:48 pm    Post subject: Reply to: Problem with Date in the Trailer record
Reply with quote

Hi Bill,

Sorry for not answering your question regarding multiple delimiters.Our reciever wants trailer record in that way,that's wht I am using multiple delimiters.
Thanks for your quick reply.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Jan 02, 2012 2:56 pm    Post subject: Re: Reply to: Problem with Date in the Trailer record
Reply with quote

pullaiah.cts wrote:
Hi Bill,

Sorry for not answering your question regarding multiple delimiters.Our reciever wants trailer record in that way,that's wht I am using multiple delimiters.
Thanks for your quick reply.


No problem, as I said, it that is what they want, it is their problem :-)

You haven't shown the DB2 date definition. Usuaully if MOVE CORRESPONDING isn't "working" it is because the names are not the same. Check that. Post the other definition if still a problem.

You are using the system date. For me, that is never a good idea. When you need to re-run something, or when it runs before/after midnight when it is normally after/before you get the "wrong" date.
Back to top
View user's profile Send private message
pullaiah.cts

New User


Joined: 02 Sep 2010
Posts: 50
Location: Pune

PostPosted: Mon Jan 02, 2012 3:08 pm    Post subject: Reply to: Problem with Date in the Trailer record
Reply with quote

Bill -

Date variables declaration:

Code:

* DATE VARIABLES                                         
 01  WS-SYS-DATE.                                       
     05  WS-SYS-CCYY                 PIC 9(04).         
     05  WS-SYS-MM                   PIC 9(02).         
     05  WS-SYS-DD                   PIC 9(02).         
                                                         
 01  WS-SYS-DATE-DB2.                                   
     05  WS-SYS-CCYY                 PIC 9(04).         
     05  FILLER                      PIC X(01) VALUE '-'.
     05  WS-SYS-MM                   PIC 9(02).         
     05  FILLER                      PIC X(01) VALUE '-'.
     05  WS-SYS-DD                   PIC 9(02).         
                                                         
 01  WS-SYS-TIME-6.                                     
     05  WS-SYS-HR                   PIC 9(02).         
     05  WS-SYS-MN                   PIC 9(02).         
     05  WS-SYS-SC                   PIC 9(02).         
                                                         
 01  WS-SYS-TIME.                                       
    05  WS-SYS-HR                   PIC 9(02).         
    05  FILLER                      PIC X(01) VALUE ':'.
    05  WS-SYS-MN                   PIC 9(02).         
    05  FILLER                      PIC X(01) VALUE ':'.
    05  WS-SYS-SC                   PIC 9(02).   
     


I din't understand about what names you are saying about,please explain.

Regarding system date:Our reciever wants the date on which the job is executed.Hence I am taking current date and time.

Please let me know if you have any question or need information to provide the solution to my question.Thanks
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Jan 02, 2012 4:31 pm    Post subject: Reply to: Problem with Date in the Trailer record
Reply with quote

What I mean by the names is that if something doesn't "correspond" it doesn't get moved (or whatever).

I don't like CORRESPONDING. However.

I can't see anything wrong with the code that you have shown.

Without seeing all the code, I'd suggest you put a display after the move to the DB2 field and when you move the trailer record.
Back to top
View user's profile Send private message
pullaiah.cts

New User


Joined: 02 Sep 2010
Posts: 50
Location: Pune

PostPosted: Mon Jan 02, 2012 6:36 pm    Post subject: Reply to: Problem with Date in the Trailer record
Reply with quote

Hi Bill,

Now I am able to print the date in the trailer record.The reson for not getting the date is,I am moving the system date to output record before execution of DATE-PARAGRAPH.So,it's moving some junk characters to Date field.Now I corrected the code and it's working fine.

Thank you so much for your support.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Jan 02, 2012 6:43 pm    Post subject: Reply to: Problem with Date in the Trailer record
Reply with quote

No worries. Thanks for letting us know.

It is Soapbox time.

Consider: tonights run happens one minute past midnight; tommorows one minute before midnight; the day afeter is one minute past midnight. You have no files dated 2 January, two files dated 3 January, no files data 4 January. Make this clear to the client.

When you have a program error, and find that you have to do a re-run, the date on the re-run will be "today", along with the genuine data for "today" (subject to the above), and if you have to do several re-runs to correct, you have them all dated today (unless running over midnight).

With the date on the trailer record, the danger is that "updating" of something will be done before identifying that the data is from the wrong date. At the moment that is less of a problem because the client will not know one day's data from another.

Please make the client aware of this, and that this is signed-off by them, if not already explicit in the specifications or other documents.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us