View previous topic :: View next topic
Author
Message
satish.ms10 Active User Joined: 10 Aug 2009Posts: 184 Location: India
Hi Team,
Hope you are doing well.
I am trying to flatten the COBOL copybook/layout into a PS file using FILE MANAGER batch program FMNMAIN. Below are the File Manager SYSIN card input:
Code:
$$FILEM SET HEADERPG=YES,PAGESIZE=60
$$FILEM PBK DSNIN=abc.xyz.pqr,
$$FILEM LANG=COBOL,
$$FILEM CBLMAXRC=04,
$$FILEM ARRAY=YES,
$$FILEM MEMLIST=(*),
$$FILEM MEMBER=cpyb187
Below is output from above step..
Code:
Few File Manager program output lines
......
......
......
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2
Ref Field Name Picture Type Start
----------------------------------------------------------------------------------------------------------------------
1 1 IN-REC AN 1
2 2 IN-FIELD1 AN 1
3 3 IN-FIELD1-A S9(16) PD 1
4 3 IN-FIELD1-B X(10) AN 10
...
...
...
12 2 IN-FIELD7 AN 74
13 3 IN-FIELD7-A 9(20) ZD 74
...
...
118 2 IN-FIELD38 AN 164
119 3 IN-FIELD38-A AN 164
120 4 IN-FIELD38-A-AA 9(6) ZD 164
...
...
Then I am trying to run DFSORT to extract only COBOL copybook field rows to another PS file. I am trying to check for Non Numeric values from 1 to 5 position and OMIT the rows if they are not equal. I tried below SORT cards
Code:
OMIT COND=(1,5,ZD,NE,NUM)
And
Code:
INREC OVERLAY=(1,5,UFF,M11,LENGTH=5)
OMIT COND=(1,5,ZD,NE,NUM)
But my SORT step is failing with below error
Code:
ICE185A 0 AN S001 ABEND WAS ISSUED BY DFSORT, ANOTHER PROGRAM OR AN EXIT (PHASE 0)
Could you please help me where I am doing the mistake in my SORT card? I am unable to find out.
Thanks in advance.
Back to top
satish.ms10 Active User Joined: 10 Aug 2009Posts: 184 Location: India
Hi,
Apologies, I have coded SYSOUT=* for SYSIN card accidentally.
I have corrected my job and job is ending with MAX CC 0 now, but, I am getting empty output with below SYSIN Cards
Code:
OMIT COND=(1,5,ZD,NE,NUM)
OPTION COPY
And
Code:
INREC OVERLAY=(1,5,UFF,M11,LENGTH=5)
OMIT COND=(1,5,ZD,NE,NUM)
OPTION COPY
1 to 5 bytes are "Ref" filed, on this data, I am omitting the rows. to get only the copybook fields details to output file.
Back to top
satish.ms10 Active User Joined: 10 Aug 2009Posts: 184 Location: India
Hi There,
I am able to get the desired output with below sort card..
Code:
INREC IFTHEN=(WHEN=INIT,OVERLAY=(134:1,5)),
IFTHEN=(WHEN=INIT,FINDREP=(IN=C' ',OUT=C'0',STARTPOS=1,ENDPOS=5))
SORT FIELDS=COPY
OUTFIL INCLUDE=(1,5,ZD,EQ,NUM,AND,1,5,ZD,GT,0),
BUILD=(1:134,5,6:6,128)
Is this the best solution for this required? Please advise
Thanks in advance.
Back to top
Rohit Umarjikar Global Moderator Joined: 21 Sep 2010Posts: 3075 Location: NYC,USA
SS - try in OMIT COND to know if 1,5 is any number .
Back to top
sergeyken Senior Member Joined: 29 Apr 2008Posts: 2119 Location: USA
Code:
INREC FINDREP=(INOUT=(C' ',C'0'),STARTPOS=1,ENDPOS=5)
SORT FIELDS=COPY
OUTFIL INCLUDE=(1,5,ZD,EQ,NUM),
OVERLAY=(1:1,5,ZD,EDIT=(IIIIT))
You did not show all possible input lines, that's why it remains unclear any potential further simplification.
Another option:
Code:
INCLUDE COND=(5,1,ZD,EQ,NUM,AND,119,1,ZD,EQ,NUM)
SORT FIELDS=COPY
Back to top
Joerg.Findeisen Senior Member Joined: 15 Aug 2015Posts: 1307 Location: Bamberg, Germany
Code:
INCLUDE COND=(1,5,SS,RE,C'^[ ]{0,4}[0-9]{1,5}')
Back to top
sergeyken Senior Member Joined: 29 Apr 2008Posts: 2119 Location: USA
Joerg.Findeisen wrote:
Code:
INCLUDE COND=(1,5,SS,RE,C'^[ ]{0,4}[0-9]{1,5}')
Rocket science used to hammer nails
Back to top
Joerg.Findeisen Senior Member Joined: 15 Aug 2015Posts: 1307 Location: Bamberg, Germany
Not really. Zero to 4 blanks are allowed, following by 1 to 5 digits. Not perfect, but should be Ok in this case.
Back to top
satish.ms10 Active User Joined: 10 Aug 2009Posts: 184 Location: India
Hi All,
Thank you so much for all your valuable suggestion on alternate approaches.
Apologies, I couldn't show all possible input lines (those are output of File Manager batch program) due to security restrictions.
I will modify my sort card based on your suggestions.
Thanks again
Back to top
sergeyken Senior Member Joined: 29 Apr 2008Posts: 2119 Location: USA
satish.ms10 wrote:
Apologies, I couldn't show all possible input lines (those are output of File Manager batch program) due to security restrictions.
Any PII data may be easily masked with XXXXXXXX or whatever else. The real question is: the format of all lines to be processed.
This is a senseless excuse.
Back to top
Joerg.Findeisen Senior Member Joined: 15 Aug 2015Posts: 1307 Location: Bamberg, Germany
In case you don't like the RE, use
Code:
INCLUDE COND=(1,5,UFF,GT,+0)
Back to top
sergeyken Senior Member Joined: 29 Apr 2008Posts: 2119 Location: USA
Joerg.Findeisen wrote:
In case you don't like the RE, use
Code:
INCLUDE COND=(1,5,UFF,GT,+0)
What's if
Code:
ABCD5 . . . . . . . . . . . . . . .
Back to top
Joerg.Findeisen Senior Member Joined: 15 Aug 2015Posts: 1307 Location: Bamberg, Germany
It is unlikely to happen with this extract, but yes, to be strict, it will produce undesirable results.
Back to top
sergeyken Senior Member Joined: 29 Apr 2008Posts: 2119 Location: USA
I insist the best solution (e.g. simple and effective) should be: check 1-byte fields at positions 5 and 119 for NUM.
Simple job requires simple solution, I guess so.
Back to top
satish.ms10 Active User Joined: 10 Aug 2009Posts: 184 Location: India
Apologies for the late reply.
I have followed 1-byte NUM value checks solution.
Back to top
Please enable JavaScript!