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

Outfil strange issue (depends on each other?)


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Messerschmitt

New User


Joined: 09 Nov 2012
Posts: 5
Location: Russia

PostPosted: Fri Nov 09, 2012 6:50 pm
Reply with quote

Hi!
I've read from dfsort manual that outrec is not dependent on conditions from previous outrecs, at least for startrec and endrec:

publib.boulder.ibm.com/infocenter/zos/v1r11/index.jsp?topic=/com.ibm.zos.r11.iceg200/ice1cg4032.htm

User guide sample code:
OUTFIL FNAMES=OUT3,STARTREC=7,ENDREC=9
OUTFIL FNAMES=OUT4,STARTREC=10

Result:
OUT3: 7, 8, 9
OUT4: 10, 11, 12 (12 records total)

My code:
-first outfil results with zero records count (it's ok - record is omitted)
-second outfil results zero records count (not ok, must be several thousands)

Code:
 
OUTFIL FNAMES=SRTOUT1,ENDREC=1,
         OMIT=  (REC_TYPE,EQ,X'01'),             
         BUILD=(1,605)                                               
                                   
OUTFIL FNAMES=SRTOUT2,STARTREC=2,                                   
         OMIT=(REC_TYPE,EQ,X'01',AND,607,15,ZD,GT,+1),                 
         BUILD=(1,605)                                               


but when i change endrec=1 to endrec=3 first outfil returns 2 records and second returns 2 records! why, they should be independent?

Furthermore, when i change sortout1 in the first outfil to sortout2
and sortout2 to sortout1 in the second outfil, i get successful output to sortout1 from second outfil!

this seems so mystical for me...
Step code is below:

Code:

//STEP005  EXEC PGM=SORT                                   
//SORTLIB  DD   DSN=SYS1.SORTLIB,DISP=SHR                 
//SYSUDUMP DD   SYSOUT=*                                   
//SYSOUT   DD   SYSOUT=*                                   
//SORTIN   DD   DSN=gdg dataset input,
//             DISP=SHR                                   
//SRTOUT1  DD   DSN=...TESTD.SRTOUT1,     
//             DISP=(NEW,CATLG),                           
//             UNIT=SYSDA,SPACE=(CYL,(5,5),RLSE),         
//             DCB=*.SORTIN                               
//SRTOUT2  DD   DSN=...TESTD.SRTOUT2,     
//             DISP=(NEW,CATLG),                           
//             UNIT=SYSDA,SPACE=(CYL,(5,5),RLSE),             
//             DCB=*.SORTIN                                   
//SYSIN    DD   *                                                 
  INREC IFTHEN=(WHEN=(REC_TYPE,EQ,X'03',OR,REC_TYPE,EQ,X'04'),
                          OVERLAY=(606:X'00')),               
            IFTHEN=(WHEN=NONE,OVERLAY=(606:X'01'))       
*
  SORT FIELDS=(RECTYPE_GROUP_ID,D,                           
               TRACEID,A,                                     
               CMDID,A,                                       
               SYSID,A,                                       
               APPLID,A,                                     
               TASKID,D,                                     
               LCL_TIME,D) 
*                                                                     
  OUTREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(REC_TYPE),PUSH=(607:SEQ=15))   
*                                                                     
  OUTFIL FNAMES=SRTOUT1,ENDREC=1,OMIT=(REC_TYPE,EQ,X'01'),             
         BUILD=(1,605)                                                 
*                                     
  OUTFIL FNAMES=SRTOUT2,STARTREC=2,                                   
         OMIT=(REC_TYPE,EQ,X'01',AND,607,15,ZD,GT,+1),                 
         BUILD=(1,605)                                                 
/*                                                                     
//SYMNOUT  DD   SYSOUT=*                                               
//SYMNAMES DD   DSN=...,     
//             DISP=SHR                                               
Back to top
View user's profile Send private message
Messerschmitt

New User


Joined: 09 Nov 2012
Posts: 5
Location: Russia

PostPosted: Fri Nov 09, 2012 7:24 pm
Reply with quote

I get
ICE054I 0 RECORDS - IN: 8374, OUT: 8374
ICE227I 0 SRTOUT1 : DELETED = 8374, REPORT = 0, DATA = 0
ICE228I 0 SRTOUT1 : TOTAL IN = 8374, TOTAL OUT = 0
ICE227I 0 SRTOUT2 : DELETED = 2, REPORT = 0, DATA = 8372
ICE228I 0 SRTOUT2 : TOTAL IN = 8374, TOTAL OUT = 8372
ICE174I 0 NO DATA RECORDS FOR AN OUTFIL DATA SET - RC=0
ICE134I 0 NUMBER OF BYTES SORTED: 5066270

but srtout2 is empty...
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Nov 09, 2012 7:37 pm
Reply with quote

Can you post the full sysout from the step please.
Back to top
View user's profile Send private message
Messerschmitt

New User


Joined: 09 Nov 2012
Posts: 5
Location: Russia

PostPosted: Fri Nov 09, 2012 7:43 pm
Reply with quote

Code:

********************************* TOP OF DATA **********************************
ICE270I 0 PROCESSING SYMNAMES STATEMENTS                                       
ICE280I 1 ORIGINAL STATEMENTS FROM SYSIN    FOLLOW                             
          * GROUP RECORDS BY RECORD TYPE                                       
          *                                                                     
            INREC IFTHEN=(WHEN=(REC_TYPE,EQ,X'03',OR,REC_TYPE,EQ,X'04'),       
                                    OVERLAY=(606:X'00')),                       
                  IFTHEN=(WHEN=NONE,OVERLAY=(606:X'01'))                       
          * BRING PREVIOUSLY GROUPED TYPES AND TASKS TOGETHER, THEN             
          * SORT BY TIME (DESC)                                                 
          *                                                                     
            SORT FIELDS=(RECTYPE_GROUP_ID,D,                                   
                         TRACEID,A,                                             
                         CMDID,A,                                               
                         SYSID,A,                                               
                         APPLID,A,                                             
                         TASKID,D,                                             
                         LCL_TIME,D)                                           
          * GROUP BY TASK START RECORD AND NUMBER GROUP MEMBERS                 
          * LATEST START IN EACH GROUP HAS SEQ=1                               
          *                                                                     
            OUTREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(REC_TYPE),PUSH=(607:SEQ=15))   
          * IF LATEST RECORD (FIRST IN SORT LIST) WAS TASK START, REMOVE IT     
          *                                                                     
            OUTFIL FNAMES=SRTOUT1,ENDREC=1,OMIT=(REC_TYPE,EQ,X'01'),           
                   BUILD=(1,605)                                               
          * REMOVE ALL TASK START RECORDS THAT ARE FOLLOWED BY OTHER TASK STARTS
          * SUCH RECORDS HAVE GROUP SEQ > 1                                     
            OUTFIL FNAMES=SRTOUT2,STARTREC=2,                                   
                   OMIT=(REC_TYPE,EQ,X'01',AND,607,15,ZD,GT,+1),               
                   BUILD=(1,605)                                               
ICE282I 0 PERFORMING SYMBOL SUBSTITUTION AS NEEDED                             
ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1                         
ICE751I 0 C5-K62149 C6-K90026 C7-K58148 C8-K67572 E9-K60824 C9-BASE   E5-K72040
ICE143I 0 BLOCKSET     SORT  TECHNIQUE SELECTED                                 
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 12:58 ON FRI NO
           INREC IFTHEN=(WHEN=(9,1,BI,EQ,X'03',OR,9,1,BI,EQ,X'04'),OVERLAY=(606:
                         '00')),IFTHEN=(WHEN=NONE,OVERLAY=(606:X'01'))         
           SORT FIELDS=(462,1,CH,D,1,8,CH,A,11,8,CH,A,27,4,CH,A,19,8,CH,A,175,4,
                         H,D,209,8,BI,D)                                       
           OUTREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(9,1),PUSH=(607:SEQ=15))         
           OUTFIL FNAMES=SRTOUT1,ENDREC=1,OMIT=(9,1,BI,EQ,X'01'),BUILD=(1,605) 
           OUTFIL FNAMES=SRTOUT2,STARTREC=2,OMIT=(9,1,BI,EQ,X'01',AND,607,15,ZD,
                         T,+1),BUILD=(1,605)                                   
ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1                         
ICE751I 0 C5-K62149 C6-K90026 C7-K58148 C8-K67572 E9-K60824 C9-BASE   E5-K72040
ICE193I 0 ICEAM1 INVOCATION ENVIRONMENT IN EFFECT - ICEAM1 ENVIRONMENT SELECTED
ICE088I 1 CIUUPDB5.STEP005 .        , INPUT LRECL = 605, BLKSIZE = 32670, TYPE =
ICE093I 0 MAIN STORAGE = (MAX,6291456,6291456)   
ICE156I 0 MAIN STORAGE ABOVE 16MB = (6234096,6234096)                           
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,
ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=1048576,MINLIM=450560,EQUALS=N,LIST=Y,ERE
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=NO   ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=
ICE130I 0 OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT=
ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW=
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE    ,EXITC
ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=2097152,SOLRF=Y,VLLONG=N
ICE235I 0 OPTIONS: NULLOUT=RC0                                                 
ICE236I 0 OPTIONS: DYNAPCT=10 ,MOWRK=Y                                         
ICE084I 0 EXCP ACCESS METHOD USED FOR SORTIN                                   
ICE750I 0 DC 5096520 TC 0 CS DSVNN KSZ 41 VSZ 41                               
ICE752I 0 FSZ=8424 RC  IGN=0 E  AVG=608 0  WSP=6652 C  DYN=52 53216             
ICE231I 0 STORAGE USED FOR OUTFIL : BELOW 16M = 20480, ABOVE 16M = 4179968     
ICE210I 0 SRTOUT1  : EXCP USED, LRECL = 605, BLKSIZE = 27830, TYPE = FB   (SDB)
ICE210I 0 SRTOUT2  : EXCP USED, LRECL = 605, BLKSIZE = 27830, TYPE = FB   (SDB)
ICE751I 1 DE-K61787 D5-K58148 D3-K58148 D7-K58148 CB-K64632 E8-K70685           
ICE055I 0 INSERT 0, DELETE 0                                                   
ICE054I 0 RECORDS - IN: 8374, OUT: 8374                                         
ICE227I 0 SRTOUT1  : DELETED = 8374, REPORT = 0, DATA = 0                       
ICE228I 0 SRTOUT1  : TOTAL IN = 8374, TOTAL OUT = 0                             
ICE227I 0 SRTOUT2  : DELETED = 2, REPORT = 0, DATA = 8372                       
ICE228I 0 SRTOUT2  : TOTAL IN = 8374, TOTAL OUT = 8372                         
ICE174I 0 NO DATA RECORDS FOR AN OUTFIL DATA SET - RC=0                         
ICE134I 0 NUMBER OF BYTES SORTED: 5066270                                       
ICE253I 0 RECORDS SORTED - PROCESSED: 8374, EXPECTED: 8424                     
ICE165I 0 TOTAL WORK DATA SET TRACKS ALLOCATED: 60 , TRACKS USED: 30           
ICE199I 0 MEMORY OBJECT USED AS MAIN STORAGE = 0M BYTES                         
ICE299I 0 MEMORY OBJECT USED AS WORK STORAGE = 4M BYTES                         
ICE180I 0 HIPERSPACE STORAGE USED = 0K BYTES                                   
ICE188I 0 DATA SPACE STORAGE USED = 0K BYTES                                   
ICE052I 0 END OF DFSORT                                                         
******************************** BOTTOM OF DATA ********************************
                             


Thanks in advance, im not sure if this forum has spoilers to hide this bunch of data...
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Nov 09, 2012 8:04 pm
Reply with quote

What does this mean?

Quote:
Thanks in advance, im not sure if this forum has spoilers to hide this bunch of data...


When you change SRTOUT2 on the OUTFIL to SRTOUT1 you get data on SRTOUT1?

Have you checked all the message output for anything related to SRTOUT2? If you temporarily change SRTOUT2 to SYSOUT=whatver and the BUILD to (1,132) do you get output on SRTOUT2?

You might want to look at ACCEPT=1 for your first OUTFIL rather than ENDREC=1, but I'm not sure as you've not actually said what it should be doing.
Back to top
View user's profile Send private message
Messerschmitt

New User


Joined: 09 Nov 2012
Posts: 5
Location: Russia

PostPosted: Fri Nov 09, 2012 8:29 pm
Reply with quote

When you change SRTOUT2 on the OUTFIL to SRTOUT1 you get data on SRTOUT1?

yes, it is when i exchange them (sortout1<->sortout2).

SYSOUT output is okay, thanks

i deleted all following steps and suddenly file output is ok. But i still dont know how it is connected with endrec.. ill post result of my research.

Thank you very much for your advice! I may try accept also, and startrec after it (next outfil). The idea was to check only first record in first outfil.

(by spoilers i mean button that expands hidden text)
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 Nov 09, 2012 9:37 pm
Reply with quote

Hello and welcome to the forum,

Quote:
(by spoilers i mean button that expands hidden text)
If we have this, i do not know how to use it icon_smile.gif

d
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Nov 09, 2012 9:39 pm
Reply with quote

Your sysout from the sort step shows data going on to SRTOUT2. Looks like one of your later steps must be loosing it if you can't see it at the end of the job. Change the DSN and you should see it.
Back to top
View user's profile Send private message
Messerschmitt

New User


Joined: 09 Nov 2012
Posts: 5
Location: Russia

PostPosted: Fri Nov 09, 2012 11:06 pm
Reply with quote

Bill Woodger wrote:
Your sysout from the sort step shows data going on to SRTOUT2. Looks like one of your later steps must be loosing it if you can't see it at the end of the job. Change the DSN and you should see it.


Yes, it was next sort step that had srtout2 as output. Its purpose is to copy srtout1 (1 record) into srtout2, and srtout 2 is output dsn of that next step. It had attribute OLD, and i didnt expect it to clear srtout2. Now i changed this attribute to MOD and all works fine. When i was changing ENDREC, contents of sortout1 were copied to sortout2 and result of this copy was in direct dependence of ENDREC value. Thats why i thought there was a problem in first step, because im not closely familiar with sort. Your advice to try SYSOUT revealed the problem.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Nov 09, 2012 11:21 pm
Reply with quote

Glad you got it. Have a good weekend.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Nov 09, 2012 11:43 pm
Reply with quote

Now I've actually read what you wrote.

Is part of your processing to make the first record on the file the last? It can be done in one step.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Nov 10, 2012 5:46 am
Reply with quote

Messerschmitt,

Nice to see the use of symbols/SYMNAMES. You can take them further, although most people here don't like them ('cept Don 'n' me) so perhaps the better examples aren't in this forum.

Away from the symbols, here's an example of moving one record from early in a file to the end of a file. The STOPAFT is like ACCEPT in that it relates to output records, so here, stop processing after one output record is written.

Code:
//MOVEREC  EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  OPTION COPY
  JOINKEYS F1=INA,FIELDS=(81,1,A),SORTED,NOSEQCK
  JOINKEYS F2=INB,FIELDS=(81,1,A),SORTED,NOSEQCK
  JOIN UNPAIRED,F1,F2
  REFORMAT FIELDS=(F1:1,80,?,F2:1,80)
  INREC  IFOUTLEN=80,
         IFTHEN=(WHEN=(81,1,CH,NE,C'1'),
             BUILD=(82,80))
//JNF1CNTL DD *
  OPTION COPY
  OMIT COND=(1,5,CH,EQ,C'DAT 3')
  INREC OVERLAY=(81:X'00')
//JNF2CNTL DD *
  OPTION COPY,STOPAFT=1
  INCLUDE COND=(1,5,CH,EQ,C'DAT 3')
  INREC OVERLAY=(81:X'FF')
//INA      DD *
HDR
DAT 1
DAT 2
DAT 3
DAT 4
DAT 5
DAT 6
DAT 7
TRL
//INB      DD *
HDR
DAT 1
DAT 2
DAT 3
DAT 4
DAT 5
DAT 6
DAT 7
TRL



The output is:

Code:
HDR 
DAT 1
DAT 2
DAT 4
DAT 5
DAT 6
DAT 7
TRL 
DAT 3
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sun Nov 11, 2012 5:03 am
Reply with quote

Looking back at your original control cards, you have a SORT. If you want one (or more) record to appear at the "end" of the file, why not just with the SORT? I probably missed something...
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts OUTFIL with SAVE option DFSORT/ICETOOL 7
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts Facing ABM3 issue! CICS 3
Search our Forums:

Back to Top