View previous topic :: View next topic
|
Author |
Message |
meltingmemories
New User
Joined: 13 Oct 2008 Posts: 16 Location: Bangalore
|
|
|
|
Hi,
I have a requirement in SORT utility. I have to sent a file to another interface. In the header record of that file I have a count value which is 6 bytes that starts from 11 – 16. I have to store this number into a flat file. Next time while I am sending this file once again I have to refer the count stored in that flat file and then increment that value by one and update it in the header value. Can we do it in SORT? How can we read a count value from a file and update that count my one and store it in the header.Please help.
Thank you. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
mm,
Is there something in the header record that can be used to identify it (e.g. 'HDR' in positions 1-3). If so, what is it? It would help if you showed an example of your input records.
What is the RECFM and LRECL of the input file? |
|
Back to top |
|
|
meltingmemories
New User
Joined: 13 Oct 2008 Posts: 16 Location: Bangalore
|
|
|
|
Yes. In the header record we have "BOF" as the first field to identify it. The RECFM of the input file is FB and LRECL is 30. The header format is given below:
Record Type
+ Applcation 1 – 8 ‘BOFXXXXX’ (hard coded value)
Blank 9 – 10 Blank
Count value 11 – 16 Numeric
Blank 17 Blank
Application details 18 – 30 (hard coded value)
I want to store this count value to a flat file before sending this file. Then next time while I am sending the file I had to refer that flat file and get the count value and increase it by 1 and sent the file. Please let me know how can i read the count value from the seqence file and increase it by 1 and put in in the header. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT/ICETOOL job that will do what I think you want. I assumed you have a count data set with RECFM=FB and LRECL=6 with the count in positions 1-6 (e.g. 000001). The job will add 1 to that count ( e.g. 000002) and save it in the header record of the input file.
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//COUNT DD DSN=... count file (FB/6) - has dddddd in 1-6
//IN DD DSN=... input file (FB/30)
//C1 DD DSN=&&C1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//OUT DD DSN=... output file (FB/30)
//TOOLIN DD *
COPY FROM(COUNT) TO(C1) USING(CTL1)
COPY FROM(IN) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
INREC BUILD=(5:C'C''',1,6,ZD,ADD,+1,TO=ZD,LENGTH=6,C'''))',80:X)
/*
//CTL2CNTL DD *
INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'BOF'),OVERLAY=(11:
/*
// DD DSN=*.C1,VOL=REF=*.C1,DISP=(OLD,PASS)
|
|
|
Back to top |
|
|
meltingmemories
New User
Joined: 13 Oct 2008 Posts: 16 Location: Bangalore
|
|
|
|
Thank you Frank. It worked fine. Do we have this feature in SORT utility? |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
Thank you Frank. It worked fine. Do we have this feature in SORT utility? |
meltingmemories,
Wh would you think that DFSORT is not a sort utility? |
|
Back to top |
|
|
meltingmemories
New User
Joined: 13 Oct 2008 Posts: 16 Location: Bangalore
|
|
|
|
The below solution was in ice tool
//S1 EXEC PGM=ICETOOL
Just want to know if we can do it in SORT/DFSORT |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
meltingmemories wrote: |
The below solution was in ice tool
//S1 EXEC PGM=ICETOOL
Just want to know if we can do it in SORT/DFSORT
|
If you have look at DFSORT documentation you will tend to read below...
Quote: |
ICETOOL is a multipurpose DFSORT utility that uses the capabilities of DFSORT
to perform multiple operations on one or more data sets in a single step.
|
So if if specifically want to use PGM=SORT.. Then you have to use multiple steps.
[/quote] |
|
Back to top |
|
|
meltingmemories
New User
Joined: 13 Oct 2008 Posts: 16 Location: Bangalore
|
|
|
|
We dont support ICE TOOL. Can you please tell me how should we do it in SORT. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Please explain what you mean by "we dont support ICETOOL".
If you have DFSORT, then you have DFSORT's ICETOOL. ICETOOL has been part of DFSORT since 1991. It's fully documented and supported.
Do you mean your site is one of those brain-dead ones where they don't allow you to use ICETOOL? Or do you mean you have Syncsort? Or what? |
|
Back to top |
|
|
meltingmemories
New User
Joined: 13 Oct 2008 Posts: 16 Location: Bangalore
|
|
|
|
Frank!!
Since requirment is to do this using SORT utilities can you please tell me if this can be done using sort.
Thank You. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
ICETOOL is a DFSORT utility. Why can't you use ICETOOL? |
|
Back to top |
|
|
meltingmemories
New User
Joined: 13 Oct 2008 Posts: 16 Location: Bangalore
|
|
|
|
Frank,
They want me to do it using SORT and not ICETOOL. I am not sure why. I had to inform them that I am going to do it in ICE TOOL. So before informing them I should be sure that this cannot be done in SORT. I have more issue in the sort result. It was given as
INREC BUILD=(5:C'C''',1,6,ZD,ADD,+1,TO=ZD,LENGTH=6,C'''))',80:X)
In the output while I increment the count I was getting the alpha characters for eg while I increment 000001, I got 00000A.
So I changed ZD to BI as
INREC BUILD=(5:C'C''',1,6,BI,ADD,+1,TO=BI,LENGTH=6,C'''))',80:X)
I was working fine but while incrementing certain count values for eg 009999, I got invalid chatacters.
Please advise!!!
|
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
eg while I increment 000001, I got 00000A. |
Does n't that sound like a Syncsort output? Which sort product are you using? DFSORT(ICE... messages in SYSOUT) or Syncsort(WER...) |
|
Back to top |
|
|
meltingmemories
New User
Joined: 13 Oct 2008 Posts: 16 Location: Bangalore
|
|
|
|
The above result was of ICE TOOL's output. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Post the output from the execution of the run. There are product informational messages created for every execution.
Copy/paste these messages including the message-ids here. |
|
Back to top |
|
|
meltingmemories
New User
Joined: 13 Oct 2008 Posts: 16 Location: Bangalore
|
|
|
|
Hi,
Please help me out.
1. I was using the ICE TOOL code given by Frank above.While I give the counter value as 000009 in the input fle, I am getting the result as
"BOFXXXXX 00000{ XXXXXX XXXXXX". Whenever there is a carry I me if we give the input as 000099 or 000999 or 009999 etc I am getting the result as same is above.How should I solve it?
2.Please tell me if we can do the same without using ICETOOL. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hello,
Quote: |
There are product informational messages created for every execution |
Post the messages from DFSMSG output of your job execution which shows the sort product information. |
|
Back to top |
|
|
meltingmemories
New User
Joined: 13 Oct 2008 Posts: 16 Location: Bangalore
|
|
|
|
Sorry for it!! The details are given below. Please let me know if this is sufficient.
TOOLMSG
SYNCTOOL RELEASE 1.5.2
DFSMSG
SYNCSORT FOR Z/OS 1.2.2.3RI 2005 SYNCSORT INC. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Not to worry - sometimes it takes a few iterations, but eventually we get there
Please notice that from your messages, you are running Syncsort, not DFSORT. I'll move your topic out of the DFSORTsection of the forum. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Change the below part
as
Try this and let know if you face any issues. |
|
Back to top |
|
|
meltingmemories
New User
Joined: 13 Oct 2008 Posts: 16 Location: Bangalore
|
|
|
|
Oops!! That is working fine!! Thanks a lot !! But still can I do this in SORT instead of using ICETOOL
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
They want me to do it using SORT and not ICETOOL. I am not sure why. |
I believe your organization needs to make a more consistent decision. . .
Either applications/developers should be permitted to use the "coding" features available in their sort product or they should not. Being permitted to code "anything" that the executable named SORT will do, but not permitted to use xxxMAN or xxxTOOL makes neither logical nor business sense. They are part of the sort product.
If your organization is not willing to support "programming" via the sort product, then it should not be permitted in pgm=sort either. For your management to say that your syntax would be perfectly acceptable if the executable was sort but the same syntax would not be valid if you execute something other than sort is really hard to follow.
The same vendor supports the underlying product code as part of the same product license (afaik). |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
meltingmemories,
Quote: |
But still can I do this in SORT instead of using ICETOOL |
Yes, but it may probably need an additional step. But the number of data passes will be more or less the same.
I know it's too late to ask, but after going through your original requirement, I m not clear with this part,
Dont you want to save the incremented value in the counter file itself? Or do you expect some other process to increment it? |
|
Back to top |
|
|
meltingmemories
New User
Joined: 13 Oct 2008 Posts: 16 Location: Bangalore
|
|
|
|
Hi,
Yes. I want to store the counter value in a file. |
|
Back to top |
|
|
|