Page 1 of 1

Reading data from a text file and manipulate in JCL

PostPosted: Thu Aug 09, 2007 1:46 am
by nvasanth_16
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.

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

PostPosted: Thu Aug 09, 2007 3:32 am
by William Thompson
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.....

Reading data from a text file and manipulate in JCL

PostPosted: Thu Aug 09, 2007 3:46 am
by nvasanth_16
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.

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

PostPosted: Thu Aug 09, 2007 7:30 am
by dick scherrer
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.

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

PostPosted: Thu Aug 09, 2007 7:38 am
by dick scherrer
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.

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

PostPosted: Sat Aug 11, 2007 5:30 am
by Frank Yaeger
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