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

convert the date in file s9(7) comp-3 to x(10)


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
d_sarlie

New User


Joined: 22 Apr 2008
Posts: 42
Location: coimbatore

PostPosted: Thu Aug 09, 2012 3:39 pm
Reply with quote

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

Code:
ACTY-TS   PIC X(10).


can someone help me with sort

Code'd
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Aug 09, 2012 3:54 pm
Reply with quote

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
View user's profile Send private message
d_sarlie

New User


Joined: 22 Apr 2008
Posts: 42
Location: coimbatore

PostPosted: Thu Aug 09, 2012 4:08 pm
Reply with quote

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
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu Aug 09, 2012 4:34 pm
Reply with quote

I am not an expert but it looks strange to me

Why date field need to be a signed field ?? icon_rolleyes.gif icon_confused.gif
Back to top
View user's profile Send private message
d_sarlie

New User


Joined: 22 Apr 2008
Posts: 42
Location: coimbatore

PostPosted: Thu Aug 09, 2012 4:41 pm
Reply with quote

This field and its value I get from upstream
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Aug 09, 2012 4:51 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Aug 09, 2012 7:29 pm
Reply with quote

Hello,

Now that you have posted 3 times, why have you not shown what you want in the x(10) field icon_confused.gif
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Aug 09, 2012 9:39 pm
Reply with quote

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
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top