View previous topic :: View next topic
|
Author |
Message |
pullaiah.cts
New User
Joined: 02 Sep 2010 Posts: 50 Location: Pune
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
pullaiah.cts
New User
Joined: 02 Sep 2010 Posts: 50 Location: Pune
|
|
|
|
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 |
|
|
pullaiah.cts
New User
Joined: 02 Sep 2010 Posts: 50 Location: Pune
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
pullaiah.cts
New User
Joined: 02 Sep 2010 Posts: 50 Location: Pune
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
pullaiah.cts
New User
Joined: 02 Sep 2010 Posts: 50 Location: Pune
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|