Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
Posted: Thu May 24, 2012 5:48 pm Post subject: How to check for Data Existence in a File
This dataset happens to be a single row FB/LRECL 80 containing control data.
Over and above checking if the file is empty I also need to check if the file has some data, where spaces should not be considered as data.
Example:
File seemingly empty ..in the sense ....all it has is a single ROW full of only spaces.
Problem:
IDCAMS REPRO with COUNT(1) option is not flagging this as EMPTY because of presence of SPACES.
However, the requirement is to consider such data/spaces as empty as well and set the MAXCC to 12.
Anyone knows how to do this check using IDCAMS or some other utility ???
It will pass back RC=0 or RC=12 by default. If you want RC=4 instead of RC=12, just add the RC4 operand to the COUNT operator like this
Code:
COUNT FROM(IN) EMPTY USING(CTL1) RC4
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
Posted: Fri May 25, 2012 3:05 pm Post subject:
papadi,
Franks /solution#2 uses ICETOOL and Kolusus /solution#1 uses DFSORT.
I am using PROC which is called by the JCL so not sure if you want all of that posted
Here is the sysout ,jesmsglg & Input Data for Soln#1
Code:
ICE143I 0 BLOCKSET COPY 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 V1R5 - 15:39 ON FRI MAY
OMIT COND=(1,80,CH,EQ,C' ')
OPTION COPY,STOPAFT=1,NULLOUT=RC4
ICE201I E RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K26318 C6-K90007 C7-K90000 C8-K23476 E9-K90007 C9-BASE E5-K31980
ICE193I 0 ICEAM1 ENVIRONMENT IN EFFECT - ICEAM1 INSTALLATION MODULE SELECTED
ICE088I 0 RSXHKA0D.SGXP540D.SGX40S05, INPUT LRECL = 80, BLKSIZE = 27920, TYPE =
ICE093I 0 MAIN STORAGE = (MAX,8388608,8388608)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (8312662,8312662)
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,
ICE128I 0 OPTIONS: SIZE=8388608,MAXLIM=2097512,MINLIM=512000,EQUALS=N,LIST=Y,ERE
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=SHORT,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=
ICE130I 0 OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT=
JESMSGLG where STEP 05 is the SORT
Code:
J E S 2 J O B L O G -- S Y S T E M U N 0 F -- N O D E
15.39.02 JOB05189 ---- FRIDAY, 25 MAY 2012 ----
15.39.02 JOB05189 ICH70001I RSXXXA LAST ACCESS AT 15:30:38 ON FRIDAY, MAY 25,
15.39.02 JOB05189 $HASP373 RSXXXA0D STARTED - INIT 1 - CLASS B - SYS UN0F
15.39.02 JOB05189 IEF403I RSXXXA0D - STARTED - TIME=15.39.02
15.39.02 JOB05189 - --TIMINGS (MINS.)--
15.39.02 JOB05189 -JOBNAME STEPNAME PROCSTEP RC EXCP CPU SRB CLOCK
15.39.02 JOB05189 -RSXXXA0D SGXP540D SGX40S03 00 95 .00 .00 .00
15.39.03 JOB05189 - --TIMINGS (MINS.)--
15.39.03 JOB05189 -JOBNAME STEPNAME PROCSTEP RC EXCP CPU SRB CLOCK
15.39.03 JOB05189 -RSXXXA0D SGXP540D SGX40S05 00 75 .00 .00 .00
15.39.03 JOB05189 - --TIMINGS (MINS.)--
15.39.03 JOB05189 -JOBNAME STEPNAME PROCSTEP RC EXCP CPU SRB CLOCK
15.39.03 JOB05189 -RSXXXA0D SGXP540D SGX40S06 FLUSH 0 .00 .00 .00
Input DS
Code:
VIEW SXXX.CHEESE.CF.COST.QTR.J540T.G0001V00 Columns 00001 00072
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
000100
****** **************************** Bottom of Data ****************************
Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
Posted: Fri May 25, 2012 3:28 pm Post subject:
dbZ .... I was so far assuming that 73 thru 80 was empty but guess what it contains ?
Code:
VIEW SXXX.CHEESE.CC.COST.QTR.J540T.G0001V00 Columns 00009 00080
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
000100 00000100
****** **************************** Bottom of Data ****************************
I am going to retry by removing the line number on RHS. Am sure it will work. Yes, silly me .. ofcors !!!
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
Posted: Fri May 25, 2012 3:30 pm Post subject:
glad you were able to resolve it.
by the way, you can avoid this problem when you edit a ds,
if you set your edit profile to NUMOFF. _________________ Dick Brenholtz
American living in Varel, Germany
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Fri May 25, 2012 3:37 pm Post subject:
Vini,
Yes, that was my first thought ... that you have sequence numbers in 73-80 so the record really isn't blank.
Dick,
Good catch. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum