Reading data from a text file and manipulate in JCL



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Reading data from a text file and manipulate in JCL

Postby nvasanth_16 » Thu Aug 09, 2007 1:46 am

Dear all,

I have already written a program in JCL that is manipulating with two fields specified in the INCLUDE statement.
This is for one time usage. Now it needs to be automated, that is one or more times it needs to be executed.
The data will be coming in one dataset with those two fields alone. Now I want to read those two fields from the dataset and need to substitute in the existing program.
please help me in this. It will be very helpful for me if anyone do this.

Thanks in advance.
nvasanth_16
 
Posts: 2
Joined: Thu Aug 09, 2007 1:36 am
Has thanked: 0 time
Been thanked: 0 time

Re: Reading data from a text file and manipulate in JCL

Postby William Thompson » Thu Aug 09, 2007 3:32 am

I have already written a program in JCL that is manipulating with two fields specified in the INCLUDE statement.
This is for one time usage. Now it needs to be automated, that is one or more times it needs to be executed.
The data will be coming in one dataset with those two fields alone. Now I want to read those two fields from the dataset and need to substitute in the existing program.
please help me in this. It will be very helpful for me if anyone do this.

You have written a program in "JCL"? OK(?)
"INCLUDE statement"?
Automated, like in "scheduler"?
"Those two fields"? Like in the "INCLUDE statement"?
You want to "read" those two fields? With what? JCL?
Existing program, written in "JCL"? Huh?

You must be more clear on your requirements, they make sense to you, but they do not explain what your requirements are to most of us.....
William Thompson
 
Posts: 81
Joined: Sat Jun 09, 2007 4:24 am
Location: Tucson AZ
Has thanked: 0 time
Been thanked: 1 time

Reading data from a text file and manipulate in JCL

Postby nvasanth_16 » Thu Aug 09, 2007 3:46 am

Hi,

I have a JCL program and the program processes with two fields namely "XX" and "YYYYY" in the given program.

Ex: INCLUDE COND=(01,02,CH,EQ,C'XX',AND,
03,05,CH,EQ,C'YYYYY')

Nowadays, I am directly substituting the values in the program on the appropriate place say 20 for XX and 34567 for YYYYY
and run the job.

In future, this task needs to be automated by the following requirement.

a)The values of XX and YYYYY will be coming in one data set.
b)When I run this job, it will automatically reads the data set and substitutes the appropriate values in XX and YYYYY and run for every record until reaches end of the record.

Please assist me in coding.
Thanks in advance.
nvasanth_16
 
Posts: 2
Joined: Thu Aug 09, 2007 1:36 am
Has thanked: 0 time
Been thanked: 0 time

Re: Reading data from a text file and manipulate in JCL

Postby dick scherrer » Thu Aug 09, 2007 7:30 am

Hello,

Please post the jcl you have written.

Then post your "control" data (the 2 fields) and some sample data they should operate on.

Lastly, post what the expected outcome will be.

It will also be helpful if you mention the recfm and lrecl of the files.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Reading data from a text file and manipulate in JCL

Postby dick scherrer » Thu Aug 09, 2007 7:38 am

Hello,

The following quote is from the second post concerning this topic. I am deleting the second topic.
Hi,

I have a JCL program and the program processes with two fields namely "XX" and "YYYYY" in the given program.

Ex: INCLUDE COND=(01,02,CH,EQ,C'XX',AND,
03,05,CH,EQ,C'YYYYY')

Nowadays, I am directly substituting the values in the program on the appropriate place say 20 for XX and 34567 for YYYYY
and run the job.

In future, this task needs to be automated by the following requirement.

a)The values of XX and YYYYY will be coming in one data set.
b)When I run this job, it will automatically reads the data set and substitutes the appropriate values in XX and YYYYY and run for every record until reaches end of the record.

Please assist me in coding.
Thanks in advance.


When adding information to your existing topic, simply "reply" to it as opposed to starting an entire new topic.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Reading data from a text file and manipulate in JCL

Postby Frank Yaeger » Sat Aug 11, 2007 5:30 am

nvasanth_16,

You can use DFSORT Symbols to do that kind of thing. Here's an example:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *     input file1
AABBBB
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
* Create DFSORT Symbols as follows:
* SYM1,'xx'
* SYM2,'yyyy'
* where xx is the value in positions 1-2 of the input record
* and yyyy is the value in position 3-6 of the input record
  OUTFIL BUILD=(C'SYM1,''',1,2,C'''',80:X,/,
    C'SYM2,''',3,4,C'''')
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD *     input file2
AABBBB RECORD 01
AACCCC RECORD 02
AABBBB RECORD 03
BBAAAA RECORD 04
/*
//SORTOUT DD SYSOUT=*    output file
//SYSIN    DD    *
  OPTION COPY
* Use SYM1 and SYM2 in the DFSORT INCLUDE statement.
  INCLUDE COND=(1,2,CH,EQ,SYM1,AND,
  3,5,CH,EQ,SYM2)
/*


SORTOUT would have:

AABBBB RECORD 01 
AABBBB RECORD 03 


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:

http://www.ibm.com/servers/storage/supp ... 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
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post