please advise me in jcl

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
josepnass@hotmail.com
Member
Posts: 5
Joined: Wed Jul 30, 2008 6:41 am
Location: wash dc

please advise me in jcl

Post by josepnass@hotmail.com » Wed Jul 30, 2008 6:59 pm

ok i have a data set and i want to extract the foloowing ssns '123450000' from column 7 into a separate data set.

2 then create a second job step to extract from the data set created the following fund code (from column 3) into yet another data set .

my email is josepnass@hotmail.com ideas welcome and examples of course thanks Mary :D
MAry J

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Wed Jul 30, 2008 8:18 pm

You can do this all in one pass with DFSORT. You didn't say what "the following fund code" is so I'll assume it's '123' for the example.

Code: Select all

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//OUT1 DD DSN=...  output file1
//OUT2 DD DSN=...  output file2
//SYSIN    DD    *
  OPTION COPY                                     
  INCLUDE COND=(7,9,CH,EQ,C'123450000')           
  OUTFIL FNAMES=OUT1                              
  OUTFIL FNAMES=OUT2,INCLUDE=(3,3,CH,EQ,C'123')   
/*
If you need more specific help, explain in more detail what you're trying to do.

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/servers/storage/support/sof ... tmpub.html
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

josepnass@hotmail.com
Member
Posts: 5
Joined: Wed Jul 30, 2008 6:41 am
Location: wash dc

Post by josepnass@hotmail.com » Wed Jul 30, 2008 10:43 pm

ok well basically read a file that exists then extract the followings ssn '123000000' from column 7


secondly create a 2nd job step to extract from the datastep created the following fund code which is in column 31, code is '131' into yet another data set advise appreciatted Thank you all
MAry J

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Wed Jul 30, 2008 10:52 pm

The job I gave you produces the output data sets you asked for. Just substitute the constants you want for the ones I used in the example, e.g. use C'123000000' instead of C'123450000' and use 'C'131' instead of C'123'.

The OUT1 data set will contain all of the records with '123000000' and the OUT2 data sets will contain all of the records with '123000000' that also have '131'.

Isn't that what you want? Try it.

Is there some reason you want to do this in two steps rather than one step?
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

josepnass@hotmail.com
Member
Posts: 5
Joined: Wed Jul 30, 2008 6:41 am
Location: wash dc

response

Post by josepnass@hotmail.com » Thu Jul 31, 2008 1:27 am

hi frank when u say pgm-iceman do i have to create a cobol pgm
MAry J

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Thu Jul 31, 2008 2:28 am

when u say pgm-iceman do i have to create a cobol pgm
No.

You must be very new to the z/OS world.

PGM=ICEMAN invokes the sort product installed at your site. A sort product (e.g. IBM's DFSORT) is a "utility" - a general purpose program that performs many functions.

Do you have access to a z/OS system? Do you know how to run a job? If so, then try running the job I posted by:

1. Adding your JOB card before my statements
2. Changing the //SORTIN DD to point to your input file or to the following if you don't have an input file to use:

Code: Select all

//SYSIN DD *
01123 123450000     
02123 123450001     
03122 123450000     
04123 123450000     
05122 223450001     
06123 123450000     
3. Changing the //OUT1 DD and //OUT2 DD to:

Code: Select all

//OUT1 DD SYSOUT=*
//OUT2 DD SYSOUT=*
If you don't have access to z/OS system or don't know how to run a job or to look at the output, then you need more help then I can give you. You'll need to find somebody at your shop who can teach you the basics.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others