View previous topic :: View next topic
|
Author |
Message |
d_sarlie
New User
Joined: 22 Apr 2008 Posts: 42 Location: coimbatore
|
|
|
|
hi,
I want to convert the date in file s9(7) comp-3 to x(10)
file date data:
Code: |
+120229
+100622
+80916
+71004 |
copybook declaration
Code: |
DATESTAMP PIC S9(7) COMP-3.
36:53,4, /*ACTY-TS |
o/p file copybook declaration
can someone help me with sort
Code'd |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
So you have YYMMDD in your packed-decimal field.
You want YYMMDD in your 10-byte character field, or what?
If not, 54,4,PD,EDIT= and a suitable EDIT mask will get you there, perhaps.
However, without describing the format of your 10-character field, we'll not get much further. |
|
Back to top |
|
|
d_sarlie
New User
Joined: 22 Apr 2008 Posts: 42 Location: coimbatore
|
|
|
|
You want YYMMDD in your 10-byte character field, or what? - Yes, I want to convert s9(7) Comp-3 Date field to 10byte character. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
I am not an expert but it looks strange to me
Why date field need to be a signed field ?? |
|
Back to top |
|
|
d_sarlie
New User
Joined: 22 Apr 2008 Posts: 42 Location: coimbatore
|
|
|
|
This field and its value I get from upstream |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
So, go wih the EDIT with a mask. Manual link in the DFOSRT forum and at the top of the page. Many examples here. Just search for EDIT. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Now that you have posted 3 times, why have you not shown what you want in the x(10) field |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
d_sarlie,
The input you have shown is 4 byte Y2V(P'yymmdd') format. Use the following control cards. I assumed that your date in PD format is at pos 1 and you need the formatted date at position 20.
Code: |
//SYSIN DD *
OPTION COPY,Y2PAST=1980
INREC OVERLAY=(20:1,4,Y2V(-))
//* |
|
|
Back to top |
|
|
|