View previous topic :: View next topic
|
Author |
Message |
girishb2
New User
Joined: 30 Sep 2006 Posts: 14
|
|
|
|
Hello,
I'm automating one job. Before the job load/process the data I have to validate it. My input PS file should have current-1 month data. The file is with 80 LRECL and at 71 position the date is there.. for e.g 08/20/2017
I have to verify it and ensure that the data is for previous month. Once I'm done with it I can load that data.
How can I do it with ICETOOL? |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2012 Location: USA
|
|
|
|
Did you try to do something yourself (before asking others to do your job)? |
|
Back to top |
|
|
girishb2
New User
Joined: 30 Sep 2006 Posts: 14
|
|
|
|
yes sergeyken, I tried SORT with "DATE1" but its not working and also I dont want to reformat the data, just to validate it. Could you please help in correcting the syntax and how can I just validate it.
SORT FIELDS=COPY
INCLUDE COND=(71,10,Y4W,LT,Y'DATE1(/)'-m) |
|
Back to top |
|
|
magesh23586
Active User
Joined: 06 Jul 2009 Posts: 213 Location: Chennai
|
|
|
|
What do you need to do when validation fails ?
Abend the job ?
Below is an example to compare the date.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
HDATE,S'&LYR4.&LMON.&DAY'
//SYMNOUT DD SYSOUT=*
//SORTIN DD YOUR INPUT
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(81:HDATE,
81:81,8,Y4T,SUBMONS,+1,TOGREG=Y4T,
89:77,4, $ YEAR
71,2, $ MON
74,2) $ DAY
OUTFIL INCLUDE=(89,8,CH,LT,81,8,CH),BUILD=(1,80)
|
|
|
Back to top |
|
|
girishb2
New User
Joined: 30 Sep 2006 Posts: 14
|
|
|
|
Thanks Magesh. I will test this with my file.
No, I dont want to abend the job. I just want to set Maxcc 2 and then have IF THEN condition to avoid running the subsequent steps if the validation fails. |
|
Back to top |
|
|
magesh23586
Active User
Joined: 06 Jul 2009 Posts: 213 Location: Chennai
|
|
|
|
I dont think maxcc 2 is possible in DFSORT.
May be you can set RC4 using DFSORT. |
|
Back to top |
|
|
girishb2
New User
Joined: 30 Sep 2006 Posts: 14
|
|
|
|
I believe this will just fetch the date. I want to validate/ensure that the dataset has previous month data and once I do, I can process it.
Thats why I was trying to DATE1. I need to know the syntax for it. I will search it in DFSORT manual and If I dont find I will ask the question |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3049 Location: NYC,USA
|
|
|
|
Try this method and change to your positions in the data set accordingly.
And then code IF conditions to subsequent steps accordingly for rest of your JCL.
Code: |
//SORTIN DD *
H20170811
D********
D********
/*
//OUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'H'),
OVERLAY=(41:DATE1,41:41,8,Y4T,SUBDAYS,47,2,ZD,TOGREG=Y4T))
OUTFIL FNAMES=OUT,NULLOFL=RC4,
INCLUDE=(1,1,CH,EQ,C'H',&,
2,6,CH,EQ,41,6,CH) |
|
|
Back to top |
|
|
girishb2
New User
Joined: 30 Sep 2006 Posts: 14
|
|
|
|
My file has input data as yyyymmdd - e.g. 20170801 and I found easy way to validate. It worked.
SORT FIELDS=COPY
INCLUDE COND=(71,08,CH,LT,DATE2) |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3049 Location: NYC,USA
|
|
|
|
Quote: |
My file has input data as yyyymmdd - e.g. 20170801 and I found easy way to validate. It worked. |
have you tried the above one. its the same format , isn't it or just overlooked? |
|
Back to top |
|
|
|