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

SYNCSORT - Suppress leading zeros in SEQNUM


IBM Mainframe Forums -> JCL & VSAM
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
kris_madras
Warnings : 1

New User


Joined: 04 Jul 2005
Posts: 31

PostPosted: Fri Feb 11, 2011 3:15 pm
Reply with quote

Hi,
I used SEQNUM in SYNCSORT to generate sequence numbers in the output file.

Code:
OUTFIL OUTREC=(12:SEQNUM,5,ZD,START=1,INCR=1


output:
00001
00002
00003
00004



The output I am seeing with leading ZEROES. Is it possible to suppress leading zeros?
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Feb 11, 2011 3:34 pm
Reply with quote

Quote:
Is it possible to suppress leading zeros?
Yes. It is.
Back to top
View user's profile Send private message
kris_madras
Warnings : 1

New User


Joined: 04 Jul 2005
Posts: 31

PostPosted: Mon Feb 14, 2011 4:28 pm
Reply with quote

Thanks.. could you post the code here?
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Mon Feb 14, 2011 5:04 pm
Reply with quote

Here's one way of modifying the SEQNUM value to have leading spaces.
Code:
//SYSIN    DD  *                                     
  SORT FIELDS=COPY                                   
  OUTFIL OVERLAY=(SEQNUM,5,ZD,01:01,5,ZD,M10,LENGTH=5)
/*             
Back to top
View user's profile Send private message
kris_madras
Warnings : 1

New User


Joined: 04 Jul 2005
Posts: 31

PostPosted: Mon Feb 14, 2011 6:53 pm
Reply with quote

Thanks.. can we use both OUTREC and OVERLAY statements together? I tried but I am getting error. Here is the original control statements.

Code:
  SORT FIELDS=(270,004,CH,A,                                           
               112,004,CH,A)                                           
  SUM FIELDS=NONE                                                       
  OUTFIL OUTREC=(12:SEQNUM,5,ZD,START=1,INCR=1,   SEQUENCE NUMBER       
                 024:270,004,                      T NUMBER           
                 039:112,004,                      D ZONE                     
                 045:088C' ',/),                    '/' PRINTS A NEW LINE         
HEADER1....
HEADER2
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Mon Feb 14, 2011 11:50 pm
Reply with quote

Quote:
can we use both OUTREC and OVERLAY statements together?
In a single OUTFIL, I think it is a NO.

AFAIK, the SEQNUM can be generated only as BI,ZD or PD. But you can modify it on your own if it is really required. And the SEQNUM STARTs from 1 and INCRements by 1 by default, so you don't really need the START and INCR subparameters here. I am away from office now and can't run a test. I can show you a possible way of achieving the same which is worth a try.
Code:
  SORT FIELDS=(270,004,CH,A,                                           
               112,004,CH,A)                                           
  SUM FIELDS=NONE       
  OUTREC OVERLAY=(12:SEQNUM,5,ZD,12:12,5,ZD,M10,LENGTH=5)
  OUTFIL OUTREC=(012:12,5,                         SEQUENCE NUMBER       
                 024:270,004,                      T NUMBER           
                 039:112,004,                      D ZONE                     
                 045:088C' ',/),                    '/' PRINTS A NEW LINE 
  ......
  .... rest of your control statements
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: Tue Feb 15, 2011 12:37 am
Reply with quote

Quote:
AFAIK, the SEQNUM can be generated only as BI,ZD or PD.


Well, I don't know about Syncsort, but DFSORT also allows FS for SEQNUM which would suppress leading zeros automatically:

Code:

  OUTFIL OUTREC=(12:SEQNUM,5,FS,START=1,INCR=1,...
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Feb 15, 2011 9:54 am
Reply with quote

SyncSort_for_zOS_1.3.2_PG wrote:
SEQNUM
Use SEQNUM to create a sequence number field within the output record. The length of the field can be from 1 to 16 bytes and can be represented in either BI, PD, or ZD formats.
DFSORT/ICETOOL Programming Guide wrote:
seqnum
specifies that a sequence number is to appear in the reformatted input record. The sequence numbers are assigned in the order in which the records are received for INREC processing. You can create BI, PD, ZD, CSF, or FS sequence numbers and control their lengths, starting values and increment values
Frank,

I ran a test and found that generating a sequence number in FS format works for my Syncsort version as well. I guess they missed it in their documentation whereas you have mentioned it clearly in the DFSORT manual.

May be Alissa could throw some light on why this is missing in the Syncsort PG 1.3.2.
Back to top
View user's profile Send private message
kris_madras
Warnings : 1

New User


Joined: 04 Jul 2005
Posts: 31

PostPosted: Thu Feb 17, 2011 4:57 pm
Reply with quote

Yes.. it is working for me as well. Thanks a lot for Arun and Frank. Seems Syncsort and DFSORT has many common options icon_smile.gif.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Feb 17, 2011 8:16 pm
Reply with quote

Glad that it worked. Yes, they do have many things in common.
Back to top
View user's profile Send private message
Anubhava

New User


Joined: 31 Jan 2022
Posts: 3
Location: INDIA

PostPosted: Thu Jun 01, 2023 4:26 pm
Reply with quote

Arun Raj wrote:
SyncSort_for_zOS_1.3.2_PG wrote:
SEQNUM
Use SEQNUM to create a sequence number field within the output record. The length of the field can be from 1 to 16 bytes and can be represented in either BI, PD, or ZD formats.
DFSORT/ICETOOL Programming Guide wrote:
seqnum
specifies that a sequence number is to appear in the reformatted input record. The sequence numbers are assigned in the order in which the records are received for INREC processing. You can create BI, PD, ZD, CSF, or FS sequence numbers and control their lengths, starting values and increment values
Frank,

I ran a test and found that generating a sequence number in FS format works for my Syncsort version as well. I guess they missed it in their documentation whereas you have mentioned it clearly in the DFSORT manual.

May be Alissa could throw some light on why this is missing in the Syncsort PG 1.3.2.


What format is FS. What is the fullform? I was looking for a solution to remove leading zeros from seqnum and found this. And it worked for me!! Thanks alot!
But this is new to me. Could you please explain or provide reference link.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1338
Location: Bamberg, Germany

PostPosted: Thu Jun 01, 2023 4:32 pm
Reply with quote

See for ex. DFSORT manual, https://www.ibm.com/docs/en/zos/2.1.0?topic=descriptions-dfsort-data-formats
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Thu Jun 01, 2023 6:16 pm
Reply with quote

Please avoid tailgating old posts and start your own new post after doing research first .
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Syncsort help SYNCSORT 3
No new posts Repeat n times by substuting SEQNUM i... DFSORT/ICETOOL 2
No new posts Replacing FILLER with FILLER<SeqNu... DFSORT/ICETOOL 2
No new posts SYNCSORT-DB2 interface SYNCSORT 0
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top