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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Is it possible of three function at one step based on sysin
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

Site Director


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

PostPosted: Thu Feb 19, 2009 11:11 am    Post subject:
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    Post subject: Is it possible of three function at one step based on sysin
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 Moderator


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

PostPosted: Thu Feb 19, 2009 9:59 pm    Post subject:
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    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 Restart=Step not working ALAK SAHA JCL & VSAM 6 Fri Jun 30, 2017 6:28 pm
No new posts What is the Extract Function in JCL dharmaraok JCL & VSAM 3 Wed Jun 14, 2017 9:12 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm


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