Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Extract data from two file into one file and PD to CH

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
bbharathiraj
Warnings : 1

New User


Joined: 26 Oct 2006
Posts: 50
Location: Chennai

PostPosted: Thu Oct 16, 2008 9:35 pm    Post subject: Extract data from two file into one file and PD to CH
Reply with quote

Hi All,

Good Day!
Could some one please help to provide the solution for the below requirement?

I have two files with the below format and field.

File1:
Lrecl=2000
Fmt= FB

Below are the field.

Code:
field Name     Start  Length             Type
DIV-CODE     1        2                    s999 COMP-3
SUB-DIV,       3       2                    s999 COMP-3
ACCT NMBR   47      9                     S9(16) COMP-3
ACCT-STATUS 132   1                     X(1)
EMP-NAME1     300   26                   X(26)
EMP-NAME2     327   26                   X(26)


File 2:

LRECL=1330
FMT=FB

Code:
field Name     Start  Length             Type
ACCT-NMBR     3        9                  S9(16) COMP-3
DOB                57       5                 S9(7) COMP-3


I want to extract the output in below format with readable format (Character format not in PD format)only if the ACCT-NMBR in file1 and file2 is same


EMP-NAME1 EMP-NAME-2 DOB ACCT-NMBR

In Below example I give only the value of ACCT-NMBR and EMP-NAME1.
Please see the position in above layout.

File1

jjjjjj1111111111111111
iiiiiiii2222222222222222
llllllll3333333333333333
iiiiiiii4444444444444444

In Below example I give only the value of ACCT-NMBR and DOB.
DOB in Julian format
File2

11111111111111111978001
22222222222222221978111
33333333333333331978222
55555555555555551978311

I want the two output File say FIle2 and FILE4 like below.
File3,the first 6 char should be masked by X in ACCT-NMBR.
File4, the ACCT-NMBR should be displayed with out masking first 6 char.

Code:

EMP-NAME1 EMP-NAME-2          DOB        ACCT-NMBR

jjjjjj         NNN         1978001   XXXXXX1111111111
iiiiiiii         GGG        1978111   XXXXXX2222222222
llllllll        QQQ        1978222   XXXXXX3333333333


I believe I gave the required information.
Please help to archive this.

Pls note Julian format in DOB is ok.
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Oct 17, 2008 4:56 am    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what I think you asked for. I assumed you wanted the output records to have a blank between each field and LRECL=80, but you can change the job as needed.

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/2000)
//IN2 DD DSN=...  input file2 (FB/1330)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT1 DD DSN=...  output file1 (FB/80)
//OUT2 DD DSN=...  output file2 (FB/80)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT1) ON(63,16,ZD) -
  WITH(55,7) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC BUILD=(1:300,26,28:327,26,
    63:47,9,PD,TO=ZD,LENGTH=16,80:X)
/*
//CTL2CNTL DD *
  INREC BUILD=(55:57,5,PD,TO=ZD,LENGTH=7,
    63:3,9,PD,TO=ZD,LENGTH=16,80:X)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT1
  OUTFIL FNAMES=OUT2,OVERLAY=(63:6C'X')
/*
Back to top
View user's profile Send private message
bbharathiraj
Warnings : 1

New User


Joined: 26 Oct 2006
Posts: 50
Location: Chennai

PostPosted: Sat Oct 18, 2008 8:09 pm    Post subject: Reply to: Extract data from two file into one file and PD to
Reply with quote

Hi Frank,

Thanks. It's working perfectly.
But before perform this process, I have using another sort step to extract the record from the File1 (RECLEN=2000) based on below condition.

Di-code should be 111.
Sub-Div should be 888 and 999
EMP-NAME1 should be start with 'BB'.
i.e 300,2,ch,eq,c'TP'

and acct-status should be 0 0r 1.

Is this possible to include this condition in the above JCL?
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Sat Oct 18, 2008 8:25 pm    Post subject:
Reply with quote

Hello,

Quote:
Is this possible to include this condition in the above JCL?
It should be. . .

You can use something like
Code:
INCLUDE COND=(17,07,CH,EQ,C'H190072')
changing the fields to meet your conditions.

Depending on what you have in the code you used to extract the needed records, it may be usable directly. If you post the original "extract code" we will be able to determine.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sat Oct 18, 2008 9:36 pm    Post subject:
Reply with quote

Quote:
EMP-NAME1 should be start with 'BB'.
i.e 300,2,ch,eq,c'TP'


Huh? Why do you say it should start with 'BB' and then show a constant of 'TP'?

At any rate, you can do what you asked for by changing the CTL1CNTL statements to the following (use 'TP' or 'BB' or whatever you need for the constant).

Code:

//CTL1CNTL DD *
  INCLUDE COND=(1,2,PD,EQ,+111,AND,         
    (3,2,PD,EQ,+888,OR,3,2,PD,EQ,+999),AND, 
    300,2,CH,EQ,C'TP',AND,                   
    132,1,SS,EQ,C'01')       
  INREC BUILD=(1:300,26,28:327,26,
    63:47,9,PD,TO=ZD,LENGTH=16,80:X)
/*
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Unable to copy data from spool in a d... srikant314 JCL & VSAM 4 Fri Jul 28, 2017 9:10 pm
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Paasing symbolic parameter to instrea... Robert Sample JCL & VSAM 2 Thu Jul 27, 2017 1:22 pm
No new posts Passing data from REXX to C programme... chong.zhou CLIST & REXX 3 Wed Jul 26, 2017 9:11 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us