JCL SORT



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

JCL SORT

Postby rahul_ibm » Sun Jun 19, 2016 12:27 am

Hi All

I have one file (File 1) which unloads data from a table whenever a request comes.
The file contains a 10 digit id. Say 0000000090

I have another file (File 2) which contains the below query.
The query is " WHERE I_CAMPAIGN = 0000000080 "

I want to sort these two files and create another output file such that the resulting file contains
WHERE I_CAMPAIGN = 0000000090

The requirement is to just replace the campaign_id in second file with the new campaign_id of first file whenever a new request comes.

Can anyone please help me to solve this.
rahul_ibm
 
Posts: 3
Joined: Sat Jun 18, 2016 11:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL SORT

 

Re: JCL SORT

Postby BillyBoyo » Sun Jun 19, 2016 12:38 am

 OPTION COPY
  INREC BUILD=(C'" WHERE I_CAMPAIGN = ',1,10,C' "')


As you have described it, there is no need to for second file to be used as input - it contains a constant value, and a value you want to use from the first file. So just take the data from the first file and use constants.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 263 times

Re: JCL SORT

Postby rahul_ibm » Sun Jun 19, 2016 1:07 am

Thank you for replying.

But is there any way that i can do this using both the files.
rahul_ibm
 
Posts: 3
Joined: Sat Jun 18, 2016 11:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL SORT

Postby enrico-sorichetti » Sun Jun 19, 2016 1:18 am

But is there any way that i can do this using both the files.

why should we waste time when You already got what You asked for ?
since the content of the second dataset is irrelevant , why do You feel that it is important to use it (*) ?
(*) for what ?
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2583
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 123 times

Re: JCL SORT

Postby rahul_ibm » Sun Jun 19, 2016 1:48 am

No, I just wanted to know it to get a knowledge of it.
Anyways its fine. And I am happy with the solution provided.

Thanks Billy and Enrico. :-)
rahul_ibm
 
Posts: 3
Joined: Sat Jun 18, 2016 11:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL SORT

Postby NicC » Sun Jun 19, 2016 1:49 pm

What has this got to do with JCL? Apart from the topic title, "JCL SORT", JCL is not mentioned. And JCL SORT is a stupid title - it is uninformative which does not help when people are searching for solutions to problems similar to yours. Topic moved to correct part of the forum.

BTW, you do not have a file - or two - you have datasets.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2663
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 100 times

Re: JCL SORT

Postby steve-myers » Sun Jun 19, 2016 5:07 pm

NicC wrote:... BTW, you do not have a file - or two - you have datasets.

NiC is absolutely right. The only "file" in z?OS systems is the data between the beginning of a tape and a "file mark," or the data between two "file marks." A "file mark" on a magnetic tape, in turn is a special data record written in a way that ensures it will get the attention of the control units that operate a tape drive that it is not ordinary data.

By the way: it is "data sets" (yes, two words), not "datasets" (one non-existent word). A mistake I'm embarrassed to confess I too, have made.
steve-myers
Global moderator
 
Posts: 1850
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 188 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post