View previous topic :: View next topic
|
Author |
Message |
nkothako
Active User
Joined: 26 Nov 2008 Posts: 125 Location: chennai
|
|
|
|
either thru ezytriev or icetool or sort or fileaid jcl
I would like to edit a file in the below cases thru
> need take an option (I- insert ,u - updated , d- delete)
> Based on first 3 characters of sysin the below function need to perform
if user gives option I then below record need to inserted
if user gives option U then below record need to update
if user gives option D then below record need to delete
Code: |
sysin dd *
----+----1----+----2----+----3----+----4----+----5----+----6
3900000MOXXXX XXXXINES XXXXXXN000
/* |
at the end of jcl based on option i need to know following
ex : no of records inserted or updated or deleted = 1
Invalid option : (option) |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You need to post a better requirement definition. Keep in mind that your request is completely clear to you but it may not be to everyone else.
The process described sounds like a master file update requirement. This would be at least 2 input files. The posted info shows only 1 file. The process described shows inserts, updates, and deletes but there are none in the "sample data".
What is needed is sample input of all input files and sample output created from that input. It would also help to mention the recfm and lrecl of the fles. When posting the sample files, they do not need to be full width - just enough to demonstrate the requirement. |
|
Back to top |
|
|
nkothako
Active User
Joined: 26 Nov 2008 Posts: 125 Location: chennai
|
|
|
|
Jcl sysin card input will be 61 bytes:
Code: |
sysin dd *
----+----1----+----2----+----3----+----4----+----5----+----6-
0050000TOXXXX XXXXINES XXXXXXN000 I
0040000FOXXXX XXXXINES XXXXXXN000 U
0020000BOXXXX XXXXINES XXXXXXN000 D
/* |
master file which needs to be modified look like below and LRECL is 60 bytes only
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6
0010000AOXXXX XXXXINES XXXXXXN000
0020000BOXXXX XXXXINES XXXXXXN000
0030000COXXXX XXXXINES XXXXXXN000
0040000EOXXXX XXXXINES XXXXXXN000 |
if the 61 by of the sysin I then record of sysin should be inserted
similarly U OR D
output should like below
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6
0010000AOXXXX XXXXINES XXXXXXN000
0030000COXXXX XXXXINES XXXXXXN000
0040000FOXXXX XXXXINES XXXXXXN000
0050000TOXXXX XXXXINES XXXXXXN000
|
Note : Record 2 needs to deleted Rec 4 is updated and Rec 5 is instered |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use a DFSORT/ICETOOL job like the following to get the output you asked for:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1 (FB/61) "sysin"
//IN2 DD DSN=... input file2 (FB/60) "master"
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=... output file (FB/60)
//TOOLIN DD *
COPY FROM(IN1) TO(T1)
COPY FROM(IN2) TO(T1) USING(CTL1)
SPLICE FROM(T1) TO(OUT) ON(1,7,CH) KEEPNODUPS WITH(1,1) -
USING(CTL2)
/*
//CTL1CNTL DD *
INREC OVERLAY=(61:C'U')
/*
//CTL2CNTL DD *
OUTFIL FNAMES=OUT,OMIT=(61,1,CH,EQ,C'D'),
BUILD=(1,60)
/*
|
Quote: |
ex : no of records inserted or updated or deleted = 1 |
You mentioned this in your first post, but didn't show it as part of the output in your second post, so I ignored it. |
|
Back to top |
|
|
|