Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Syncsort - Incrementing a count value number in the header
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort - Incrementing a count value number in the header
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 Moderator


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

PostPosted: Wed Oct 15, 2008 9:19 pm    Post subject:
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    Post subject: Reply to: Incrementing a count value number in the header
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 Moderator


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

PostPosted: Thu Oct 16, 2008 10:35 pm    Post subject:
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    Post subject: Reply to: Incrementing a count value number in the header
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: 2158
Location: @my desk

PostPosted: Fri Oct 17, 2008 10:06 am    Post subject:
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    Post subject: Reply to: Incrementing a count value number in the header
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    Post subject:
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    Post subject: Reply to: Incrementing a count value number in the header
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 Moderator


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

PostPosted: Fri Oct 17, 2008 11:07 pm    Post subject:
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    Post subject: Reply to: Incrementing a count value number in the header
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 Moderator


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

PostPosted: Sat Oct 18, 2008 8:59 pm    Post subject:
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    Post subject: Reply to: Incrementing a count value number in the header
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: 2158
Location: @my desk

PostPosted: Sun Oct 19, 2008 12:48 pm    Post subject:
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    Post subject: Reply to: Incrementing a count value number in the header
Reply with quote

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

Site Director


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

PostPosted: Sun Oct 19, 2008 1:34 pm    Post subject:
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    Post subject: Reply to: Incrementing a count value number in the header
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: 2158
Location: @my desk

PostPosted: Sun Oct 19, 2008 2:22 pm    Post subject:
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    Post subject: Reply to: Incrementing a count value number in the header
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

Site Director


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

PostPosted: Sun Oct 19, 2008 2:44 pm    Post subject:
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us