basically, I want to build the output file using DFSORT so that the "timestamp" in the first 19 positions has a blank between the date and the time, and uses a : as the time separator rather than a dot. So 2005-06-21-16.52.45 becomes 2005-06-21 16:52:45.
I'm guessing that I need to use DATE4 and either some sort of Rexx equivalent of SUBSTR or a MASK or ......
This is the trouble in a way. If I knew what I needed to use, I could google it, but not knowing WHAT to look for kind of limits you. _________________ Michael
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Thu Dec 20, 2018 9:05 pm Post subject:
misi01 wrote:
I would like the "timestamp" to be the same for all output records if possible
Quite simple. Add an INREC statement after REFORMAT statement and on OUTFIL use the BUILD to refer the DATE4 fields. I just coded for 1 file, you can do the same for the other OUTFIL file.
Code:
//SYSIN DD *
* CONTROL STATEMENTS FOR JOINKEYS APPLICATION
JOINKEYS FILE=F1,FIELDS=(31,10,A,51,48,A),SORTED,NOSEQCK
JOINKEYS FILE=F2,FIELDS=(32,10,A,51,48,A),SORTED,NOSEQCK
JOIN UNPAIRED
REFORMAT FIELDS=(F1:1,260,F2:1,260,?)
INREC OVERLAY=(522:DATE4) <<< New stmt
* CONTROL STATEMENTS FOR MAIN TASK (JOINED RECORDS)
OPTION COPY
OUTFIL FNAMES=F1ONLY,INCLUDE=(521,1,CH,EQ,C'1'),
BUILD=(522,10, $ DATE AS CCYY-MM-DD
X, $ SPACE
533,02, $ HH
C':', $ COLON
536,02, $ MM
C':', $ COLON
539,02, $ SS
1,260) $ REST OF DATA
OUTFIL FNAMES=F2ONLY,INCLUDE=(521,1,CH,EQ,C'2'),
BUILD=(261,260)
PS: You may want to get rid off the SORTOUT dd as it will write all the records whether they matched or not.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum