MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DATE4 in BUILD statement (?)

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 620
Topics: 173
Location: Stockholm, Sweden

PostPosted: Thu Dec 20, 2018 9:48 am    Post subject: DATE4 in BUILD statement (?) Reply with quote

Here are the first few records of my 2 files that I am matching. First, the master file
Quote:

2018-12-19 19:10:15MASTER 10100000000000 00567108042855ANAUTOM008085005
2018-12-19 19:10:15MASTER 10100042551159 00567108042855ANAUTOM008085005
2018-12-19 19:10:15MASTER 10100042551159 00567108042855ANAUTOM008085005
2018-12-19 19:10:15MASTER 10100042551159 00577108012154HF 008085005
2018-12-19 19:10:15MASTER 10100042551159 00593007081753PÃ… 008085005
2018-12-19 19:10:15MASTER 10100042551159 00596007071852ÄNAUTOM008085005
2018-12-19 19:10:15MASTER 10100042551159 00596007071852ÄNAUTOM008085005
2018-12-19 19:10:15MASTER 10100042551159 00596707071151ÄNAUTOM008085005
2018-12-19 19:10:15MASTER 10100042551159 00596707071151ÄNAUTOM008085005



Secondly the "delta" file
Quote:

2018-12-19 19:10:15HHHWK02 10100027051125 00651606012021ANBIASB109681006
2018-12-19 19:10:15HHHWK02 10100027051125 00651606012021ANBIASB109681006
2018-12-19 19:10:15HHHWK02 10100027051125 00651606012021ANBIASB109681006
2018-12-19 19:10:15HHHWK02 10100027051125 00655405121320MICHAEL109681006
2018-12-19 19:10:15HHHWK02 10100042551159 00567108042855ANAUTOM008085005
2018-12-19 19:10:15HHHWK02 10100042551159 00567108042855ANAUTOM008085005
2018-12-19 19:10:15HHHWK02 10100042551159 00577108012154HF 008085005
2018-12-19 19:10:15HHHWK02 10100042551159 00593007081753PÃ… 008085005
2018-12-19 19:10:15HHHWK02 10100042551159 00596007071852ÄNAUTOM008085005
2018-12-19 19:10:15HHHWK02 10100042551159 00596007071852ÄNAUTOM008085005


Both files are FB,lrecl 260.

Here are my DFSORT statements
Code:

//JKE5      EXEC  PGM=SORT                                       
//SYSOUT    DD  SYSOUT=*                                         
//SORTJNF1  DD DISP=SHR,DSN=SIMMIC.DIALTELT.MASTER.SMALL         
//SORTJNF2  DD DISP=SHR,DSN=SIMMIC.DIALTELT.HHHWK02.SMALL       
//F1ONLY    DD SYSOUT=*                                         
//F2ONLY    DD SYSOUT=*                                         
//BOTH      DD SYSOUT=*                                         
//SORTOUT   DD SYSOUT=*                                         
//SYSIN     DD    *                                             
* CONTROL STATEMENTS FOR JOINKEYS APPLICATION                   
  JOINKEYS FILE=F1,FIELDS=(31,10,A,51,48,A),SORTED,NOSEQCK       
  JOINKEYS FILE=F2,FIELDS=(31,10,A,51,48,A),SORTED,NOSEQCK       
  JOIN UNPAIRED,F1,F2                                           
  REFORMAT FIELDS=(F1:1,260,F2:1,260,?)                         
* CONTROL STATEMENTS FOR MAIN TASK (JOINED RECORDS)             
  OPTION COPY                                                   
  OUTFIL FNAMES=F1ONLY,INCLUDE=(521,1,CH,EQ,C'1'),               
    BUILD=(1,260)                                               
  OUTFIL FNAMES=F2ONLY,INCLUDE=(521,1,CH,EQ,C'2'),               
    BUILD=(261,260)                                             
/*                                                               


Basically, we already have an Easytrieve program that does this (plus produces some statistics).

What I'm not sure on how to do is the following. The easytrieve program changes the heading so the output there looks similar to this
Quote:

2018-12-20 15:32:56NDPPLCH2 N10100027051125 00651606012021ANBIASB109681006
2018-12-20 15:32:56NDPPLCH2 N10100027051125 00651606012021ANBIASB109681006
2018-12-20 15:32:56NDPPLCH2 N10100027051125 00651606012021ANBIASB109681006
2018-12-20 15:32:56NDPPLCH2 N10100027051125 00655405121320MICHAEL109681006
2018-12-20 15:32:56NDPPLCH2 N2012127946 106 00176018110206FA 069571001
2018-12-20 15:32:56NDPPLCH2 N2012127946 106 00178118101205FA 069571001


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
Back to top
View user's profile Send private message Send e-mail
misi01
Advanced


Joined: 02 Dec 2002
Posts: 620
Topics: 173
Location: Stockholm, Sweden

PostPosted: Thu Dec 20, 2018 11:10 am    Post subject: Reply with quote

Forgot to mention in the original append.

I would like the "timestamp" to be the same for all output records if possible
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12368
Topics: 75
Location: San Jose

PostPosted: Thu Dec 20, 2018 9:05 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
misi01
Advanced


Joined: 02 Dec 2002
Posts: 620
Topics: 173
Location: Stockholm, Sweden

PostPosted: Fri Dec 21, 2018 3:08 am    Post subject: Reply with quote

Thanks Kolusu - worked a treat.
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group