IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Syncsort - Incrementing a count value number in the header


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
meltingmemories

New User


Joined: 13 Oct 2008
Posts: 16
Location: Bangalore

PostPosted: Wed Oct 15, 2008 12:57 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Oct 15, 2008 9:19 pm
Reply with quote

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
View user's profile Send private message
meltingmemories

New User


Joined: 13 Oct 2008
Posts: 16
Location: Bangalore

PostPosted: Thu Oct 16, 2008 12:34 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Oct 16, 2008 10:35 pm
Reply with quote

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
View user's profile Send private message
meltingmemories

New User


Joined: 13 Oct 2008
Posts: 16
Location: Bangalore

PostPosted: Fri Oct 17, 2008 9:54 am
Reply with quote

Thank you Frank. It worked fine. Do we have this feature in SORT utility?
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Oct 17, 2008 10:06 am
Reply with quote

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
View user's profile Send private message
meltingmemories

New User


Joined: 13 Oct 2008
Posts: 16
Location: Bangalore

PostPosted: Fri Oct 17, 2008 10:13 am
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Fri Oct 17, 2008 12:02 pm
Reply with quote

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
View user's profile Send private message
meltingmemories

New User


Joined: 13 Oct 2008
Posts: 16
Location: Bangalore

PostPosted: Fri Oct 17, 2008 12:10 pm
Reply with quote

We dont support ICE TOOL. Can you please tell me how should we do it in SORT.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Oct 17, 2008 11:07 pm
Reply with quote

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
View user's profile Send private message
meltingmemories

New User


Joined: 13 Oct 2008
Posts: 16
Location: Bangalore

PostPosted: Sat Oct 18, 2008 8:11 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat Oct 18, 2008 8:59 pm
Reply with quote

ICETOOL is a DFSORT utility. Why can't you use ICETOOL?
Back to top
View user's profile Send private message
meltingmemories

New User


Joined: 13 Oct 2008
Posts: 16
Location: Bangalore

PostPosted: Sun Oct 19, 2008 11:56 am
Reply with quote

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!!!
icon_confused.gif
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Sun Oct 19, 2008 12:48 pm
Reply with quote

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
View user's profile Send private message
meltingmemories

New User


Joined: 13 Oct 2008
Posts: 16
Location: Bangalore

PostPosted: Sun Oct 19, 2008 1:18 pm
Reply with quote

The above result was of ICE TOOL's output.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Oct 19, 2008 1:34 pm
Reply with quote

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
View user's profile Send private message
meltingmemories

New User


Joined: 13 Oct 2008
Posts: 16
Location: Bangalore

PostPosted: Sun Oct 19, 2008 2:00 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Sun Oct 19, 2008 2:22 pm
Reply with quote

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
View user's profile Send private message
meltingmemories

New User


Joined: 13 Oct 2008
Posts: 16
Location: Bangalore

PostPosted: Sun Oct 19, 2008 2:40 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Oct 19, 2008 2:44 pm
Reply with quote

Hello,

Quote:
Sorry for it!!
Not to worry - sometimes it takes a few iterations, but eventually we get there icon_smile.gif

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Sun Oct 19, 2008 2:59 pm
Reply with quote

Change the below part
Quote:
ZD,ADD,+1,TO=ZD,
as
Quote:
ZD,ADD,+1,TO=ZDF,

Try this and let know if you face any issues.
Back to top
View user's profile Send private message
meltingmemories

New User


Joined: 13 Oct 2008
Posts: 16
Location: Bangalore

PostPosted: Sun Oct 19, 2008 3:54 pm
Reply with quote

Oops!! That is working fine!! Thanks a lot !! But still can I do this in SORT instead of using ICETOOL
icon_cry.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Oct 20, 2008 3:56 am
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Oct 20, 2008 7:45 am
Reply with quote

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
View user's profile Send private message
meltingmemories

New User


Joined: 13 Oct 2008
Posts: 16
Location: Bangalore

PostPosted: Mon Oct 20, 2008 12:14 pm
Reply with quote

Hi,
Yes. I want to store the counter value in a file.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top