Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to simplify this code

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
farouck

New User


Joined: 12 Apr 2006
Posts: 18
Location: France

PostPosted: Mon Jan 12, 2009 5:47 pm    Post subject: How to simplify this code
Reply with quote

I wrote this job but I think that we can simply it :
for bypassing the records that don't mach my select

for expand packed decimal PD(2) to pd(5)

My input file (lrecl 23, recfm FB) is
YEC8505 520081216.í....
YEC8505 520081218.Ññ%..
YEC8505 520081220.Ñ æ..
YEC8505 520081222.ÍÉð..
YEC8505 F20081224.Èâ%..
YEC8505 520081225.Å{<..
YEC8505 520081226.Äß...
YEC8505 520081227.ËÑ%..
YEC8505 520091201.ËÑ%..
YEC8505 420091202.ËÑ%..

I have no duplicate key on 1,17
and i have packed decimal on 18,4

My jcl is :
Code:

//VR011505 EXEC PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                           
//DFSMSG   DD SYSOUT=*                                           
//OUT      DD DSN=N4GX.TEMPS.SIG.VR01004G.ICE.OUTBIS,           
//            DISP=SHR                                           
//OUT2     DD DSN=&&OUT2,DISP=(MOD,PASS),                       
//            SPACE=(CYL,(1,1),RLSE)                             
//OUT3     DD DSN=N4GX.TEMPS.SIG.VR01004G.ICE,                   
//            DISP=(,CATLG,DELETE),
//            RECFM=FB,                                         
//            UNIT=WORKP,                                       
//            SPACE=(23,(1,1),RLSE),AVGREC=K 
//TOOLIN   DD *                                               
  SELECT FROM(OUT) TO(OUT2) ON(1,17,CH) NODUPS USING(CTL1)     
  COPY FROM(OUT2) TO(OUT3) USING(CTL2)                         
//CTL1CNTL DD *                                               
     INREC IFTHEN=(WHEN=(9,1,CH,EQ,C'5',AND,16,2,CH,NE,C'01'),
     BUILD=(1:C'VM02    ',9:10,1,10:11,7,17:18,4,PD,           
     TO=ZD,24:C'000',27:C'N')),                               
     IFTHEN=(WHEN=(9,1,CH,EQ,C'F'),                           
     BUILD=(1:C'VM10    ',9:10,1,10:11,7,17:18,4,PD,           
     TO=ZD,24:C'000',27:C'N')),                               
     IFTHEN=(WHEN=NONE,                                       
     BUILD=(1:C'BYPASS RECORD'))                               
//CTL2CNTL DD *                                               
  OUTFIL FNAMES=OUT3,                                         
  OMIT=(1,13,CH,EQ,C'BYPASS RECORD'),                         
       BUILD=(1:1,16,17:17,10,ZD,                             
       TO=PD,23:C'N')                             


The output file is :

VM02 20081216..ë...N
VM02 20081218.ãmo..N
VM02 20081220.ãm...N
VM02 20081222.åï...N
VM02 20081225.ãÍ...N
VM02 20081226.ã.l..N
VM02 20081227.å.o..N
VM10 20081224.å@...N
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Jan 12, 2009 9:39 pm    Post subject:
Reply with quote

It's not clear what you're trying to do. Please don't expect us to to jump into the middle of the job you created and figure out what you want. We can't read your mind.

Start from the beginning. How are we supposed to interpret gibberish like Ññ%.. in your example records - show PD fields in hexadecimal or decimal. Explain the "rules" in detail for getting from input to output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of each relevant field.
Back to top
View user's profile Send private message
farouck

New User


Joined: 12 Apr 2006
Posts: 18
Location: France

PostPosted: Tue Jan 20, 2009 6:22 pm    Post subject: Reply to: How to simplify this code
Reply with quote

Hi,
My input file is :
YEC8505 5200812012150,00
YEC8505 5200812161450,00
YEC8505 5200812172550,00
YEC8505 8200812172850,00
YEC8505 F200812175950,00

Lrecl 23 Recm fB
The key is on 1,17 she is unique
On 9,1 it is type code of the record
On 11,7 it is the date of the record (YYYYMMDD)
On 18,4 it is packed decimal

The output file must be( lrecl23 Recfm FB):

VM02 200812161450,00000
VM02 200812172550,00000
VM10 200812175950,00000



When the type code on 9,1 is '5' and the day of the date is not 01 on 16,2
i write 'VM02 ' on 1;
the date on 10;
the packed decimal on 17 but it must be expand
xxxx,xx to xxxx,xxxxx
N on 23.

When the type code on 9,1 is 'F'
i write 'VM10 ' on 1;
the date on 10;
the packed decimal on 17 but it must be expand
xxxx,xx to xxxx,xxxxx
N on 23.
In other cases i omit the records

I hope that it is more clear
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Jan 20, 2009 11:20 pm    Post subject:
Reply with quote

Considering you said "I have no duplicate key on 1,17" why are you using SELECT with NODUPS? If you don't have any duplicates, then the SELECT will just give you a sorted version of the input file. So you could just use SORT instead of SELECT. What am I missing here?

Also, you said the date field is 11,7 but it appears to be 10,8.

At any rate, here's a better DFSORT/ICETOOL job that will give you the same output as your job.

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//IN       DD DSN=N4GX.TEMPS.SIG.VR01004G.ICE.OUTBIS,
//            DISP=SHR
//OUT      DD DSN=N4GX.TEMPS.SIG.VR01004G.ICE,
//            DISP=(,CATLG,DELETE),
//            UNIT=WORKP,
//            SPACE=(23,(1,1),RLSE),AVGREC=K
//TOOLIN   DD *
  SORT FROM(IN) TO(OUT) USING(CTL1)
/*
//CTL1CNTL DD *
  INCLUDE COND=((9,1,CH,EQ,C'5',AND,16,2,CH,NE,C'01'),
     OR,9,1,CH,EQ,C'F')
  INREC IFTHEN=(WHEN=(9,1,CH,EQ,C'5',AND,16,2,CH,NE,C'01'),
     BUILD=(1:C'VM02',9:10,8,
       17:18,4,PD,MUL,+1000,TO=PD,LENGTH=6,23:C'N')),
    IFTHEN=(WHEN=NONE,
     BUILD=(1:C'VM10',9:10,8,
       17:18,4,PD,MUL,+1000,TO=PD,LENGTH=6,23:C'N'))
  SORT FIELDS=(1,16,CH,A)
/*
Back to top
View user's profile Send private message
farouck

New User


Joined: 12 Apr 2006
Posts: 18
Location: France

PostPosted: Wed Jan 21, 2009 9:29 pm    Post subject:
Reply with quote

Thanks you very much Franck,

Your jcl is ok for me.

PS : It is true i don't need the SELECT
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm
No new posts Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us