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

how to add date & timestamp to the end of the record


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

New User


Joined: 10 Mar 2011
Posts: 45
Location: india

PostPosted: Thu Apr 18, 2019 2:45 pm
Reply with quote

I need to add date & timestamp to the end of the record .

I am using the below sort card:

INREC FIELDS=(1:1,6,7:DATE4) but i am not getting any value.

Input :
Dharma

Output should be:
DharmayyyyMMddHHmmssSS5

Please let me know how to do it
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Apr 18, 2019 3:14 pm
Reply with quote

Surely it should be on the output phase and possibly using BUILD?
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Thu Apr 18, 2019 3:23 pm
Reply with quote

The following works for me but the result is not quite as you say you expect.

Code:
  OPTION COPY                 
  INREC FIELDS=(1:1,6,7:DATE4)


result has separators:

Code:
Dharma2019-04-18-10.50.44



Garry
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Apr 18, 2019 3:45 pm
Reply with quote

Are you sure that you are using DFSORT rather than SYNCSORT - although very similar there may be differences

See here ibmmainframes.com/viewtopic.php?t=33389

If you are getting WER messages, you are using SYNCSORT
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Fri Apr 19, 2019 7:05 pm
Reply with quote

dharmaraok wrote:
I am using the below sort card:
INREC FIELDS=(1:1,6,7:DATE4) but i am not getting any value.

Please, clarify what do you mean, exactly:
    - did you get no records in your output?
    - did you get a record with only 6 first characters?
    - did you get a record with 6 first characters followed by blanks/zeroes?
    - did you get a record with 6 first characters followed by a sort of garbage?
    - did you really provide any input non-empty dataset when calling SORT?
    - did you get no output dataset ("file") at all?
    - did you get any error message in the SORT log?
    - did you get any clarification/explanation/statistics message in your SORT log?
    - did you get no SORT log at all?
    - did you get JCL error, and your job was not run at all?
    - whatever else?


It sounds like
Quote:
I tried to drive my car but I'm not getting to my destination.
What do I wrong?
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1255
Location: Bamberg, Germany

PostPosted: Mon Apr 22, 2019 12:29 pm
Reply with quote

Is the red marked desired output a fixed constant?
Quote:
yyyyMMddHHmmssSS5


If yes, use what Garry has suggested but instead of BUILD use OVERLAY and go on there with an UFF conversion. Blank out excessive fields, but you should see yourself what to do.
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts To get the count of rows for every 1 ... DB2 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
Search our Forums:

Back to Top