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

Syncsort Header Issue.


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

New User


Joined: 14 Jul 2006
Posts: 93
Location: Chennai,India

PostPosted: Fri May 28, 2010 3:09 pm
Reply with quote

Hi,


I am using SYNCSORT FOR Z/OS 1.3.2.1R. I need to re-create the Header and trailer(elimate the duplicates) for a set of detailed records
RECFM=FB and LRECL=80



Input Records

Code:
H20100519000001122               
Cdetail   
Adetail   
T000001122                       
H20100519000001122               
Cdetail   
Adetail   
T000001122 



Expected Output
Code:
HYYYYMMDD000000004
Cdetail   
Adetail
Cdetail   
Adetail
T000000004



where XXXXXXXXXX is the count of the number of records.




I tried the following sort card...


Code:
SORT FIELDS=(2,10,CH,A)                                   
OMIT COND=(1,1,CH,EQ,C'H',OR,1,1,CH,EQ,C'T')           
OUTFIL FILES=OUT,REMOVECC,                                 
HEADER1=(1:C'H',2:DATENS=(4MD),12:COUNT=(M11,LENGTH=09),
TRAILER1=(1:C'T',COUNT=(M11,LENGTH=9)) 




However.....its abending showing error near the COUNT in the Header. Can we use the COUNT parameter in the HEADER field or is it limited to TRAILER alone?

Code:
HEADER1=(1:C'H',2:DATENS=(4MD),12:COUNT=(M11,LENGTH=09),
                                *   





I am looking to achieve this in a single pass.Any pointers will be real helpful.

regards,
Syam
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri May 28, 2010 5:27 pm
Reply with quote

Given the trailer already has the count why do you want it be duplicated.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri May 28, 2010 5:32 pm
Reply with quote

Hi,


without seeing the error message, my guess is that you cannot use COUNT with HEADER1.

After all, the HEADER is the first record written out, the count will not occur until all input records have been read.


Gerry
Back to top
View user's profile Send private message
skkp2006

New User


Joined: 14 Jul 2006
Posts: 93
Location: Chennai,India

PostPosted: Fri May 28, 2010 5:44 pm
Reply with quote

Arun,
That is a part of the requirement to have the count in the Header as well. Currently the program which creates this file is opening the file in I-O mode and re-writing the Header to have the count.


Gerry,

Here is the sysout.

Code:
SYSIN :                                                 
  SORT FIELDS=(2,10,CH,A)                               
  OMIT COND=(1,1,CH,EQ,C'H',OR,1,1,CH,EQ,C'T')           
  OUTFIL FILES=OUT,REMOVECC,                             
  HEADER1=(1:C'H',2:DATENS=(4MD),COUNT=(M11,LENGTH=9)), 
                                *                       
  TRAILER1=(1:C'T',COUNT=(M11,LENGTH=9))                 
  OUTFIL FNAMES=SYM,REMOVECC,NODETAIL,                   
       BUILD=(80X),                                     
  TRAILER1=('NEWCT,''',COUNT=(M11,LENGTH=9),C'''')       
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR               
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000           
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE 




Regards,

Syam
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri May 28, 2010 8:17 pm
Reply with quote

Hello

I dont have access to mainframe. I guess it is not as direct as you have tried.
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: Fri May 28, 2010 8:39 pm
Reply with quote

Hello,

Suggest you consider using the existing process. . .

To get the count in the header you will probably need another full pass of the data which is most wasteful. . .
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Fri May 28, 2010 8:44 pm
Reply with quote

According to the manual, COUNT is valid on a TRAILER, but it does not show it being valid on a HEADER.

No matter how much you want it to be so, it is not.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri May 28, 2010 9:00 pm
Reply with quote

Quote:
I am looking to achieve this in a single pass.Any pointers will be real helpful.
Since the data is (probably) already in the sequence you need to count, do one pass as copy with the omits and generate the header and trailer as a two record trailer. Then re-sort to re-sequence the headers to their proper location.
Seems a more elegant solution than re-reading the file in i/o mode......
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: Fri May 28, 2010 9:17 pm
Reply with quote

Hello,

But still has to pass all of the data "again". . . I realize that lots of files are only a few records, but my "little" files are multi-million records. . . Extra passes/sorts of data are not my friend icon_smile.gif

[Rant]
Personally, i believe it is nonsense to require the total record count in the first record ("header" or otherwise) . . . But there are lots of nonsensical requirements.
[/Rant]
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri May 28, 2010 9:25 pm
Reply with quote

Currently the OP is sortiing the entire file (pass one) and then (COBOL?) reading the entire file to get the trailer counts and rewriting the headers (pass two).
I would think that two sort passes would be a lot quicker than the one i/o pass.....
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: Fri May 28, 2010 10:00 pm
Reply with quote

Hello,

Possibly i read this wrong, but sounded like the data was created in one "pass" and the the first record was then re-read and updated directly with no additional reading of the rest of the records.
Back to top
View user's profile Send private message
skkp2006

New User


Joined: 14 Jul 2006
Posts: 93
Location: Chennai,India

PostPosted: Mon May 31, 2010 12:25 pm
Reply with quote

Hi,


The existing process is
1.Table unload of the data.
2.Process the records in a cobol program which creates the header and trailer. The same program updates the header for the file in I-O mode in the end.

Both 1 and 2 are happening for a set of records using different selection process(Job1 thru 3) and getting concatenated as an input file to process in the subsquent job(Job4).
the input for this job will have multiple header and trailers with different counts in various files.

Before the job process this file i have to feed the updated count in the Header and Trailer.

Code:
  Job1                      Job 2                    Job 3
  HYYYYMMDD000000003        HYYYYMMDD000000002       HYYYYMMDD000000001
  detail                    detail                   detail
  detail                    detail                   T000000001
  detail                    T000000002   
  T000000003     



Code:
  Job 4
  HYYYYMMDD000000003
  detail
  detail
  detail
  T000000003
  HYYYYMMDD000000002
  detail
  detail
  T000000002
  HYYYYMMDD000000001
  detail
  T000000001



Here before the Job4 starts the Header and Trailer should be updated with 6 as the count.


Syam
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 SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts Facing ABM3 issue! CICS 3
Search our Forums:

Back to Top