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

Look for the header and set RC


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

New User


Joined: 09 Jan 2009
Posts: 88
Location: India

PostPosted: Tue Jul 27, 2010 4:00 pm
Reply with quote

Hi Guys,
Could you please help me with this.

I need to look for the header and set the RC of the job based on search result. I have used the search facility and got an idea. But, the RC is set '0' when the search string is available in the file also when not available.
Code:

//S1 EXEC PGM=SORT                                             
//SYSOUT DD SYSOUT=*                                           
//SORTIN DD DSN=ft.try.dataset,DISP=SHR     
//SORTOUT DD DUMMY                                             
//SYSIN DD *                                                   
  OPTION COPY,STOPAFT=1,NULLOUT=RC16                           
  OMIT COND=(1,6,SS,EQ,C'PAR')                                 
/*                                                             


INput file LRECL 80, FB

Many thanks,
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 Jul 27, 2010 10:31 pm
Reply with quote

Quote:
But, the RC is set '0' when the search string is available in the file also when not available.


Then you must be doing something you're not telling us about. When I ran this, it worked fine for both cases:

This give RC=16:

Code:

//S1 EXEC PGM=SORT                       
//SYSOUT DD SYSOUT=*                     
//SORTIN DD *                           
 PAR                                     
//SORTOUT DD DUMMY                       
//SYSIN DD *                             
  OPTION COPY,STOPAFT=1,NULLOUT=RC16     
  OMIT COND=(1,6,SS,EQ,C'PAR')           
/*                                       


This gives RC=0:

Code:

//S1 EXEC PGM=SORT                       
//SYSOUT DD SYSOUT=*                     
//SORTIN DD *                           
 XXX 
//SORTOUT DD DUMMY                       
//SYSIN DD *                             
  OPTION COPY,STOPAFT=1,NULLOUT=RC16     
  OMIT COND=(1,6,SS,EQ,C'PAR')           
/*                                       


If that doesn't work the same for you, you need to show us the jobs and input you used and the //SYSOUT messages you received.
Back to top
View user's profile Send private message
smijoss

Active User


Joined: 30 Aug 2007
Posts: 114
Location: pune

PostPosted: Wed Jul 28, 2010 7:42 am
Reply with quote

Hi Frank ,

It doesnt. i had checked it.
Include 3 - 4 input line in you input. the requirement is to check only the first line. and since STOPAFT functions after OMIT
it give a RC 0 even if you have PAR in 3rd input record.

the solution that was mentioned here earlier was good (i.e combination of OUTFIL and NULLOFL )

correct me if i am wrong
Back to top
View user's profile Send private message
THINKSRINIII
Warnings : 1

New User


Joined: 09 Jan 2009
Posts: 88
Location: India

PostPosted: Wed Jul 28, 2010 9:16 am
Reply with quote

Frank Yaeger wrote:
Quote:
But, the RC is set '0' when the search string is available in the file also when not available.


Then you must be doing something you're not telling us about. When I ran this, it worked fine for both cases:

This give RC=16:

Code:

//S1 EXEC PGM=SORT                       
//SYSOUT DD SYSOUT=*                     
//SORTIN DD *                           
 PAR                                     
//SORTOUT DD DUMMY                       
//SYSIN DD *                             
  OPTION COPY,STOPAFT=1,NULLOUT=RC16     
  OMIT COND=(1,6,SS,EQ,C'PAR')           
/*                                       


This gives RC=0:

Code:

//S1 EXEC PGM=SORT                       
//SYSOUT DD SYSOUT=*                     
//SORTIN DD *                           
 XXX 
//SORTOUT DD DUMMY                       
//SYSIN DD *                             
  OPTION COPY,STOPAFT=1,NULLOUT=RC16     
  OMIT COND=(1,6,SS,EQ,C'PAR')           
/*                                       


If that doesn't work the same for you, you need to show us the jobs and input you used and the //SYSOUT messages you received.



Frank,
Below are the Job,Input i have used and the sysout generated.

1. Input FB 115
Code:


----+----1----+----2----+----3----+----4----+----5----+----6---
***************************** Top of Data *********************
XXXPARMORDERSFUP                I                             
TEST1505A                              HY  345678           
NASA                   ATLANTIS                               


2. JCL

Code:

//S1 EXEC PGM=SORT                                           
//SYSOUT DD SYSOUT=*                                         
//SORTIN DD DSN=TEST.DATASET,DISP=SHR     
//SORTOUT DD DUMMY                                           
//SYSIN DD *                                                 
  OPTION COPY,STOPAFT=1,NULLOUT=RC16                         
  OMIT COND=(1,6,SS,EQ,C'PAR')                               
/*                                                           


3. Sysout Generated

Code:

ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 04:37 ON WED JUL 28, 2010 -
            OPTION COPY,STOPAFT=1,NULLOUT=RC16
            OMIT COND=(1,6,SS,EQ,C'PAR')
ICE201I F RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K48846 C6-K90014 C7-K45047 C8-K46331 E9-K47759 C9-BASE   E5-K48846 E7-K48846
ICE193I 0 ICEAM1 INVOCATION ENVIRONMENT IN EFFECT - ICEAM1 ENVIRONMENT SELECTED
ICE088I 0 PNFEMS  .S1      .        , INPUT LRECL = 115, BLKSIZE = 23460, TYPE = FB
ICE093I 0 MAIN STORAGE = (MAX,6291456,6282334)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (6217303,6217303)
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,RESET=Y,VSAMEMT=Y,DYNSPC=256
ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=1048576,MINLIM=450560,EQUALS=N,LIST=Y,ERET=RC16 ,MSGDDN=SYSOUT
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=NO   ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=N,DYNALOC=N             ,ABCODE=MSG
ICE130I 0 OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT=N,COBEXIT=COB2
ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW=Y,DSA=0
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE    ,EXITCK=S,PARMDDN=DFSPARM ,FSZEST=N
ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMIO=N,MOSIZE=MAX
ICE235I 0 OPTIONS: NULLOUT=RC16
ICE084I 0 BSAM ACCESS METHOD USED FOR SORTOUT
ICE084I 0 EXCP ACCESS METHOD USED FOR SORTIN
ICE751I 1 EF-K49535 F0-K49038 E8-K48846
ICE090I 0 OUTPUT LRECL = 115, BLKSIZE = 23460, TYPE = FB
ICE055I 0 INSERT 0, DELETE 1
ICE054I 0 RECORDS - IN: 2, OUT: 1
ICE052I 0 END OF DFSORT



Many thanks for your help.
Back to top
View user's profile Send private message
smijoss

Active User


Joined: 30 Aug 2007
Posts: 114
Location: pune

PostPosted: Wed Jul 28, 2010 11:01 am
Reply with quote

Buddy just a common sense....

just change your SORTOUT DD statement from DUMMY to SYSOUT=*
and check the output

it would display the row
TEST1505A HY 345678

see the trace says it all :
ICE054I 0 RECORDS - IN: 2, OUT: 1


that means you sort is getting records and so it wont give a RC16


i think you had read the solution yesterday ... didnt you ???
Back to top
View user's profile Send private message
THINKSRINIII
Warnings : 1

New User


Joined: 09 Jan 2009
Posts: 88
Location: India

PostPosted: Wed Jul 28, 2010 11:33 am
Reply with quote

Thanks mate. I had directed the output to a dataset to check the results. I did try now with SORTOUT=*, But , still the RC requirement is not satisfied.

"that means you sort is getting records and so it wont give a RC16" - So, this may the root cause for that. I did not know this. Thanks. I will look at the manual again.
Back to top
View user's profile Send private message
THINKSRINIII
Warnings : 1

New User


Joined: 09 Jan 2009
Posts: 88
Location: India

PostPosted: Wed Jul 28, 2010 11:46 am
Reply with quote

I tried with the following Job modifying to SORTOUT to DUMMY and it works as expected.

Many thanks for all your help.

Code:

//STEP0001 EXEC PGM=SORT                                 
//SYSOUT DD SYSOUT=*                                     
//SORTIN DD DSN=TEST.DATASET,DISP=SHR
//SORTOUT DD DUMMY                                       
//SYSIN DD *                                             
  OPTION COPY,STOPAFT=1                                 
  OUTFIL OMIT=(1,6,SS,EQ,C'###PARM'),NULLOFL=RC4         
/*               
                                       

Apologies for a lengthy thread for a simple solution.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Wed Jul 28, 2010 7:22 pm
Reply with quote

THINKSRINIII,
Although you have what you needed, but why would you use 2 different omit conditions?

Code:
OPTION COPY,STOPAFT=1,NULLOUT=RC16
OMIT COND=(1,6,SS,EQ,C'PAR')


Code:
OPTION COPY,STOPAFT=1
OUTFIL OMIT=(1,6,SS,EQ,C'###PARM'),NULLOFL=RC4


Thanks,
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: Wed Jul 28, 2010 10:37 pm
Reply with quote

THINKSRINIII,

I guess I misunderstood your requirement. I thought you wanted to look for 'PAR' in the header (first) record. At this point, I'm still not sure what you're trying to do or what your input looks like. If you still need more help on this, please explain more clearly what you are trying to do with good examples of the possible cases.
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 Insert header record with record coun... DFSORT/ICETOOL 14
No new posts Comparing Header and Trailer. DFSORT/ICETOOL 7
No new posts Adding a header when change data DFSORT/ICETOOL 6
No new posts Insert System Runtime in HEADER In SY... SYNCSORT 9
No new posts Create Header Dtae as MMDDYYYY DFSORT/ICETOOL 16
Search our Forums:

Back to Top