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 Header Issue.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort Header Issue.
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: 2158
Location: @my desk

PostPosted: Fri May 28, 2010 5:27 pm    Post subject: Reply to: Syncsort Header Issue.
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: 1703
Location: Australia

PostPosted: Fri May 28, 2010 5:32 pm    Post subject:
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    Post subject: Reply to: Syncsort Header Issue.
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: 2158
Location: @my desk

PostPosted: Fri May 28, 2010 8:17 pm    Post subject:
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

Site Director


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

PostPosted: Fri May 28, 2010 8:39 pm    Post subject:
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: 645
Location: Pennsylvania

PostPosted: Fri May 28, 2010 8:44 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Fri May 28, 2010 9:00 pm    Post subject:
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

Site Director


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

PostPosted: Fri May 28, 2010 9:17 pm    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Fri May 28, 2010 9:25 pm    Post subject:
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

Site Director


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

PostPosted: Fri May 28, 2010 10:00 pm    Post subject:
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    Post subject: Reply to: Syncsort Header Issue.
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 1 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 DFHRESPONSE returns issue divated CICS 3 Wed Nov 02, 2016 6:32 pm
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am


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