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

Add number in header with Syncsort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
priyanka.msharma
Warnings : 1

New User


Joined: 28 Jan 2009
Posts: 12
Location: India

PostPosted: Wed Oct 07, 2009 4:08 pm
Reply with quote

Hi,

I have a header and I want to add +3 in cycle number.

E.g. H5444 where "5444" is the cycle number.

I want to make it "5447". Is there any utility that can give me desired result.

Also, that cycle number is required to be populated in multiple places in same header record.

Thanks,
Priyanka
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Oct 07, 2009 4:12 pm
Reply with quote

As you have posted in the JCL forum, we can only assume that your product is SYNCSORT.

From the information you have bothered to give us there is not much that is useful to helping anyone suggest a solution.

1) RECFM & LRECL of the input file
2) Positions of the occurrences of this particular value.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Oct 07, 2009 4:16 pm
Reply with quote

Hi,
Quote:
Also, that cycle number is required to be populated in multiple places in same header record.
How are we supposed to know those multiple positions?

Suggest you show some sample header record and the expected output from that. Some one would be around witha helping note if that can be done using sort.

And which sort product do you use?
Back to top
View user's profile Send private message
priyanka.msharma
Warnings : 1

New User


Joined: 28 Jan 2009
Posts: 12
Location: India

PostPosted: Wed Oct 07, 2009 4:25 pm
Reply with quote

Eg. H5444200910075444Q

file length 100

So I want to have output as
H5447200910075447Q
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Oct 07, 2009 4:28 pm
Reply with quote

Yes, but which sort product are you using, DFSORT, SYNCSORT or CA-SORT
Back to top
View user's profile Send private message
priyanka.msharma
Warnings : 1

New User


Joined: 28 Jan 2009
Posts: 12
Location: India

PostPosted: Wed Oct 07, 2009 4:30 pm
Reply with quote

Any SORT product could be used.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Oct 07, 2009 4:33 pm
Reply with quote

Ho hummmmmmmmmmm. Which sort product do you have installed at your site. It is no good whatsoever getting a CA-SORT solution for the DFSORT product.

The solution will vary from product to product, so this is why we need to know which product YOU will be executing to ensure that the solution offered is correct icon_evil.gif
Back to top
View user's profile Send private message
priyanka.msharma
Warnings : 1

New User


Joined: 28 Jan 2009
Posts: 12
Location: India

PostPosted: Wed Oct 07, 2009 4:35 pm
Reply with quote

SYNCSORT
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Oct 08, 2009 6:10 am
Reply with quote

Hi,

what happens when the header cycle number is 9997 and you add 3 to it ?

will it be 10000 or 0000 and what happens to the extra byte ?


Gerry
Back to top
View user's profile Send private message
priyanka.msharma
Warnings : 1

New User


Joined: 28 Jan 2009
Posts: 12
Location: India

PostPosted: Thu Oct 08, 2009 10:40 am
Reply with quote

No I need this for One-Time job, rest every day's batch job has programming logic to convert the cycle number back to 0001 icon_smile.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Oct 08, 2009 10:51 am
Reply with quote

priyanka.msharma wrote:
No I need this for One-Time job, rest every day's batch job has programming logic to convert the cycle number back to 0001 icon_smile.gif
Just a suggestion...If you already have such a logic/program in place, why not just modify the program itself to add 1 at multple places in the header. Anyways, when "counter" is set back to 0001 it would be set at multple places so your program already know those places where you need to update...
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Oct 08, 2009 11:02 am
Reply with quote

Hi,

this might help
Code:
//STEP0001 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                             
H5444200910075444Q                                         
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                             
 SORT FIELDS=COPY                                           
 INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'H'),                       
       BUILD=(1,1,2,4,ZD,ADD,+3,EDIT=(TTTT),               
              6,8,14,4,ZD,ADD,+3,EDIT=(TTTT),18,83))       
/*                                                         



Gerry
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

 


Similar Topics
Topic Forum Replies
No new posts COBOL Ascending and descending sort n... COBOL Programming 5
No new posts Count the number of characters in a f... CA Products 1
No new posts Want to mask Middle 8 Digits of Debit... COBOL Programming 3
No new posts Comparing Header and Trailer. DFSORT/ICETOOL 7
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
Search our Forums:

Back to Top