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

Is it possible of three function at one step based on sysin


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

Active User


Joined: 26 Nov 2008
Posts: 125
Location: chennai

PostPosted: Thu Feb 19, 2009 11:02 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Feb 19, 2009 11:11 am
Reply with quote

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
View user's profile Send private message
nkothako

Active User


Joined: 26 Nov 2008
Posts: 125
Location: chennai

PostPosted: Thu Feb 19, 2009 11:28 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Thu Feb 19, 2009 9:59 pm
Reply with quote

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
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 Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts Calling an Open C library function in... CICS 1
No new posts DATE2 function SYNCSORT 15
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts Help on PL/I jsonPutValue function PL/I & Assembler 8
Search our Forums:

Back to Top