Count a specific Type in file & update trailer with count



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Count a specific Type in file & update trailer with count

Postby shri2win » Thu Jun 06, 2013 11:47 pm

Hello,
I am working on a requirement to count the occurence of a specific record in a file and update the trailer with the count vale.
All the records are RECFM=FB and LRECL=133, input file format is as-
ISA*00* *00*
GS*PC*XX*123456*130603*
ST*830*000226250*
N1*ST*C*
SE*
ST*830*000226250*
N1*ST*C*
SE*
ST*830*000226250*
N1*ST*C*
SE*
ST*830*000226250*
N1*PN I*
SE*000032*0
GE*ZZZZZZ*0
IEA*00001*0

I have to count all the "ST" (at the start of record, position 1) records and update the count value in record "GE".
For example- in the file mentioned above, there are 4 "ST" records here. So "GE*ZZZZZZ*0" should be => GE*4*0

Here is what I have done.

000090 //STEP7 EXEC PGM=SORT                                           
000091 //SYSOUT  DD SYSOUT=*                                           
000092 //SORTIN  DD DSN=SECZ1L8.A.S830SRT4,DISP=SHR                   
000093 //SORTOUT DD DSN=SECZ1L8.A.S830SRT5,DISP=(NEW,                 
000094 //        CATLG,DELETE),UNIT=SYSDA,RECFM=FB,                   
000095 //        LRECL=133,SPACE=(CYL,(50,50),RLSE)                   
000096 //SYSIN   DD *                                                 
000097   OPTION COPY                                                   
000098   INREC IFOUTLEN=133,IFTHEN=(WHEN=(1,2,SS,EQ,C'ST,GE'),         
000099   OVERLAY= (134:SEQNUM,6,FS,START=0,                           
000100             004:134,6,JFY=(SHIFT=LEFT,TRAIL=C'*0',LENGTH=130)))
000101 //*                                                             
000102 /*     


After running the JCL, i get RC=0016. Here is the log info -

IEF403I SS$Z1L8T - STARTED - TIME=10.06.58                           
IEC130I SORTMSG  DD STATEMENT MISSING                               
+WER268A SS$Z1L8T,STEP7   ,        -INREC STATEMENT   : SYNTAX ERROR
+WER275A SS$Z1L8T,STEP7   ,        -NO KEYWORDS FOUND ON CONTROL STATEMENT
+WER211B SS$Z1L8T,STEP7   ,        -SYNCSMF  CALLED BY SYNCSORT; RC=0000
+WER449I SS$Z1L8T,STEP7   ,        -SYNCSORT GLOBAL DSM SUBSYSTEM
ACTIVE
IEF655I INVALID DSNAME SPECIFIED WHEN SYSIN OR SYSOUT SPECIFIED


Please help, thanks.
shri2win
 
Posts: 1
Joined: Thu Jun 06, 2013 11:40 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Count a specific Type in file & update trailer with count

 

Re: Count a specific Type in file & update trailer with coun

Postby Akatsukami » Fri Jun 07, 2013 12:19 am

  1. You should enclose your JCL, data, etc. -- aything where alignment is important -- in Code tags.
  2. Your control cards should not begin in column 1.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1053
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Count a specific Type in file & update trailer with coun

Postby dick scherrer » Fri Jun 07, 2013 1:39 am

Hello,

Your post has been "Code'd". You need to use the Code tag in the future.

You need to look in the Syncsort documentation and/or some of the topics here in the forum to see why your syntax is invalid.

You need to post what you want as output from that sample input.

I seem to recall a very similar (exact same?) topic recently. Do NOT post the same question multiple times/places. It will not help you get better replies and several of us will silently delete duplicate posts.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Count a specific Type in file & update trailer with coun

Postby NicC » Fri Jun 07, 2013 9:42 pm

I cannot lock anywhere else but I can here. Lockking.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post