Posted: Wed Dec 19, 2007 8:12 am Post subject: Need to insert variable values in the record
Hi ,
I have a req i.e i need to create a output file in the following format
Code:
***************** Top of Data *******************************
LOAD DATA RESUME YES LOG NO NOCOPYPEND
INTO TABLE C0C.T5987
PART 12 REPLACE KEEPDICTIONARY
************** Bottom of Data *******************************
My problem is that the number 12 in the above format comes from differenet file as input and daily in that record we get only one record in that file and rest of the data inth above format is same every day.
Values in the file may be in this format
day1 value in the input file is
12
so the output should be
Code:
***************** Top of Data *******************************
LOAD DATA RESUME YES LOG NO NOCOPYPEND
INTO TABLE C0C.T5987
PART 12 REPLACE KEEPDICTIONARY
************** Bottom of Data *******************************
Day 2 value in the input file is
1,29,30,31
so the output should be
Code:
***************** Top of Data *******************************
LOAD DATA RESUME YES LOG NO NOCOPYPEND
INTO TABLE C0C.T5987
PART 1,29,30,31 REPLACE KEEPDICTIONARY
************** Bottom of Data *******************************
1,29,30,31 this is the maximum value we can get in the file for a pariticluar day.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Wed Dec 19, 2007 11:13 am Post subject:
Here's a DFSORT job that will do what you asked for. I assumed you wanted the output file to have RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Last edited by Frank Yaeger on Wed Dec 19, 2007 11:35 am; edited 1 time in total
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Dec 19, 2007 11:16 am Post subject:
sivafdms,
Since you are building LOAD cards it does not matter if you have spaces in between , so here is a DFSORT JCL which will give you the desired results. I just put 2 records in the file to show you how it would generate for the min and max values.
Thanks for reply. this code completed half of my requirement.
This code well when the input record lenght is 10 , as i told u before the input records are not constant.
I want the o/p file not like this when i/p record is 11
Code:
********************** TOP OF DATA **********************************
LOAD DATA RESUME YES LOG NO NOCOPYPEND
INTO TABLE C0C.T5987
PART 11 REPLACE KEEPDICTIONARY
******************* BOTTOM OF DATA ********************************
i don't want spaces , so i want the o/p like this
********************* TOP OF DATA **********************************
LOAD DATA RESUME YES LOG NO NOCOPYPEND
INTO TABLE C0C.T5987
PART 11 REPLACE KEEPDICTIONARY
******************* BOTTOM OF DATA ********************************
Is it that your requirement needs to be done only thru sort?
If no, then few lines of REXX will do what you are looking for. _________________ Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
The above errors are NOT DFSORT error messages. They are from your JCL check software. Please run the job shown by Frank and it will give you the desired results.
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
Posted: Fri Dec 21, 2007 2:49 pm Post subject:
To clarify: ICE-prefixed messages indicate DFSORT, WER-prefixed ones indicate Syncsort regardless of the name of the program named in the PGM= statement. _________________ ....Terry
http://www.ibm.com/storage/dfsort/ _________________ Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum