View previous topic :: View next topic
Author
Message
pema_yozer New User Joined: 16 Feb 2009Posts: 54 Location: pune
Hi,
I have a requirement of counting the no of line and charters in a file of format FB 315 and putting them in a new file.
Eg
this should give an o/p
Code:
00000000030000000012
i have compleated the no of lines but am stuck for the no of characters,
can any one help me with it .
Code:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=input
//SORTOUT DD DSN=output,
// DISP=(NEW,CATLG),
// UNIT=KEEP,RECFM=FB,LRECL=518,
// SPACE=(CYL,(1000,50),RLSE)
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(COUNT=(M11,LENGTH=10))
/*
this is wat i have used .
Back to top
shankar.v Active User Joined: 25 Jun 2007Posts: 196 Location: Bangalore
pema_yozer,
Please check with the below code.
Code:
// EXEC PGM=ICETOOL
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//IN DD DSN=FB315.IN,DISP=SHR
//T1 DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,1)
//T2 DD DSN=&&T2,DISP=(,PASS),SPACE=(CYL,1)
//T3 DD DSN=&&T3,DISP=(,PASS),SPACE=(CYL,1)
//OUT DD DSN=FB315.OUT,DISP=MOD
//TOOLIN DD *
COPY FROM(IN) TO(T1) USING(CTL1)
COPY FROM(T1) TO(T2) USING(CTL2)
COPY FROM(T2) TO(T3) USING(CTL3)
COPY FROM(IN) TO(OUT)
COPY FROM(T3) TO(OUT)
/*
//CTL1CNTL DD *
OPTION COPY
OUTFILE REMOVECC,FTOV,VLTRIM=X'40'
/*
//CTL2CNTL DD *
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(COUNT=(M11,LENGTH=10),TOT=(1,2,BI,M11,LENGTH=10))
/*
//CTL3CNTL DD *
OUTFIL REMOVECC,VTOF,VLFILL=X'40',
OUTREC=(5,10,15,10,ZD,SUB,(5,10,ZD,MUL,+4),M11,LENGTH=10,315:X)
/*
//
FB315.IN:
FB315.OUT:
Code:
abc de
fg
hi k
00000000030000000012
Thanks,
Shankar
Back to top
pema_yozer New User Joined: 16 Feb 2009Posts: 54 Location: pune
hey man thank, just one small modification , i just want
00000000030000000012 in the o/p and could you give me a brief explanation of the code.
Back to top
pema_yozer New User Joined: 16 Feb 2009Posts: 54 Location: pune
i ran your code but am getting the following error
DFSORT CALL 0001 FOR COPY FROM IN TO T1 USING CTL1CNTL TERMINATED
ICE602I 0 OPERATION RETURN CODE: 16
any idea
Back to top
gcicchet Senior Member Joined: 28 Jul 2006Posts: 1702 Location: Australia
Hi,
you should post all messages, I bet there is also a message
Quote:
ICE056A 9 CTL1OUT NOT DEFINED
I believe you need a later version of DFSORT.
I'm having similar issues.
Gerry
Back to top
pema_yozer New User Joined: 16 Feb 2009Posts: 54 Location: pune
yup ,thats there too
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
If you don't have z/OS DFSORT V1R5 PTF UK90013 (July, 2008), then you need to specify FNAMES=ddname on the OUTFIL statement where ddname corresponds to the ddname in
TO(ddname). For example:
Code:
OUTFILE FNAMES=T1,REMOVECC,FTOV,VLTRIM=X'40'
With the PTF, you don't need to specify FNAMES=ddname.
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
pema,
Here's a better way to do what you want with DFSORT:
Code:
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file (FB/315)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=... output file (FB/20)
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
COPY FROM(T1) USING(CTL2)
/*
//CTL1CNTL DD *
OPTION COPY
OUTFIL FNAMES=T1,FTOV,VLTRIM=X'40'
/*
//CTL2CNTL DD *
OPTION COPY
OUTREC BUILD=(1,4,5:1,2,BI,SUB,+4,TO=ZD,LENGTH=10)
OUTFIL FNAMES=OUT,REMOVECC,NODETAIL,VTOF,
BUILD=(20X),
TRAILER1=(COUNT=(M11,LENGTH=10),TOT=(5,10,ZD,TO=ZD,LENGTH=10))
/*
Back to top
pema_yozer New User Joined: 16 Feb 2009Posts: 54 Location: pune
Thanks, it worked great
Back to top
pema_yozer New User Joined: 16 Feb 2009Posts: 54 Location: pune
1 more thing can i get the output as
no of line (no of char + line )
abc de
fg
hi k
this should give
00000000030000000015
Thanks Pema
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Sure. Just change the OUTREC statement to:
Code:
OUTREC BUILD=(1,4,5:(1,2,BI,SUB,+4),ADD,+1,TO=ZD,LENGTH=10)
That will add 1 to the total for each line.
Back to top
Please enable JavaScript!