|
View previous topic :: View next topic
|
| Author |
Message |
Guru Prasath
New User

Joined: 04 Jun 2008 Posts: 36 Location: Chennai
|
|
|
|
Hi,
I caught with this case in production..
I have to introduce one DFSORT step in my production JCL, which reads the counter file from the latest GDG and writes to +1 of the same GDG after adding +1with the counter file ...
Ex:
My input file has just one line as below:
| Code: |
| 20081006_____000005000*counter |
Output file:
| Code: |
| 20081006_____000005001*counter |
counter file starts from the 17theh position . record format is VB of length 80.
Thanks,
Guru. |
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Below is the code will work for you..
Just use sortin as current GDG
and sortout as (+1) generation
| Code: |
//SORTIN DD *
20081006_____000005000
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(1,13,14,9,C'01')
OUTREC FIELDS=(1,13,(14,9,ZD,ADD,23,02,ZD),EDIT=(TTTTTTTTT))
/*
|
|
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Guru,
Sambhaji's control statements are more complex than they need to be.
Here are the DFSORT control statements you need:
| Code: |
OPTION COPY
INREC OVERLAY=(14:14,9,ZD,ADD,+1,TO=ZD,LENGTH=9)
|
|
|
| Back to top |
|
 |
Guru Prasath
New User

Joined: 04 Jun 2008 Posts: 36 Location: Chennai
|
|
|
|
Hi Frank,
I have tried your solution, but what i got in the output as shown below, instead of getting 4508 , i got 450I . i tried with input 4508, that time i got 450H. Please let me know , whats wrong with this?
input :
| Code: |
----+----1----+----2----+----3---
2008100702071006000004507*COUNTER |
output:
| Code: |
----+----1----+----2----+----3---
200810070207100600000450H*COUNTER |
Hi Sambhaji,
Your solution is adding the counter perfectly. But i am loosing the rest of fields after the counter and i am getting low-values in that, instead of spaces. Please let me know, how to correct it?
| Code: |
----+----1----+----2----+----3---
2008100702071006000004508................................... |
[/code]
One more thing, my counter position starts at 17th position of length 9.
Thanks,
Guru. |
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
| Quote: |
But i am loosing the rest of fields after the counter and i am getting low-values in that, instead of spaces. Please let me know, how to correct it?
|
Guru. Can you post your sortcard? and sortin
| Quote: |
Sambhaji's control statements are more complex than they need to be.
|
Yes definately Frank, I couldnt thought of your solution at that point of time.  |
|
| Back to top |
|
 |
Guru Prasath
New User

Joined: 04 Jun 2008 Posts: 36 Location: Chennai
|
|
|
|
Sambahji,
here is my sort card,
| Code: |
OPTION COPY
INREC OVERLAY=(1,16,17,9,C'01')
OUTREC FIELDS=(1,16,(17,9,ZD,ADD,26,02,ZD),EDIT=(TTTTTTTTT))
|
Sort in (as given below):
| Code: |
----+----1----+----2----+----3---
2008100702071006000004507*COUNTER |
|
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Its looking like your length is 33
so inrec should be modified to
INREC OVERLAY=(1,33,34:C'01')
and OUTREC will be
OUTREC FIELDS=(1,16,(17,9,ZD,ADD,34,02,ZD),EDIT=(TTTTTTTTT),26,8) |
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Also it should work perfectly fine with solution given by Frank also,
| Code: |
INREC OVERLAY=(17:17,9,ZD,ADD,+1,TO=ZD,LENGTH=9) |
|
|
| Back to top |
|
 |
Guru Prasath
New User

Joined: 04 Jun 2008 Posts: 36 Location: Chennai
|
|
|
|
Sambhaji,
here is my edited sort card:
| Code: |
OPTION COPY
INREC OVERLAY=(1,49,50:C'01')
OUTREC FIELDS=(1,16,(17,9,ZD,ADD,50,02,ZD),EDIT=(TTTTTTTTT),26,24) |
Why i made changes to this is till 49 position i have some values. I can able to retain the values till that position. But after that i am getting LOW-VALUES , which i don't want. (from 50th to 80)
output:
| Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
2008100702071006000004508*0000COUNTER in sequence............................ |
Please help me in removing the low values?
Also, as i told early , i have tried frank's solution but i am getting characters in the last field. (ex 450I or 450H )
Thanks,
Guru |
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
What is LRECL of your file?
| Code: |
INREC OVERLAY=(1,49,[i](here you should use lrecl+1)[/i]:C'01')
|
|
|
| Back to top |
|
 |
Guru Prasath
New User

Joined: 04 Jun 2008 Posts: 36 Location: Chennai
|
|
|
|
No,
i have tried that. it's throwing S0C7 error.
INREC OVERLAY=(1,49,81:C'01')
is there any way to removing the low-values? |
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10899 Location: italy
|
|
|
|
| Quote: |
| also, as i told early , i have tried frank's solution but i am getting characters in the last field. (ex 450I or 450H ) |
usually people having issues with Frank' solution have not described properly their problem
You should review Your understanding of zoned number representation ...
the 450i and 450h are the signed zoned decimal representation
with a proper high nibble sign c/f for positive d for negative
c being the preferred nibble as in this case
| Code: |
450i = "f4f5f0c9"x which means a positive 4509
450h = "f4f5f0c8"x which means a positive 4508
|
so after all what You see are not chars in se but the representation of a signed digit |
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
| Post your whole step here.. |
|
| Back to top |
|
 |
Guru Prasath
New User

Joined: 04 Jun 2008 Posts: 36 Location: Chennai
|
|
|
|
Hi enrico,
Yes, i understood the problem, which you explained.
Could you provide me the solution , how to fix this problem? Please help me in fixing this?
Sambhaji,
| Code: |
//SORTIN DD DSN=my.gdg(0),DISP=SHR
//SORTOUT DD DSN=my.gdg(+1),
// DISP=(NEW,CATLG,CATLG),
// UNIT=SYSDA,SPACE=(TRK,(5,1),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(1,49,81:C'01')
OUTREC FIELDS=(1,16,(17,9,ZD,ADD,50,02,ZD),EDIT=(TTTTTTTTT),26,24) |
|
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
| Quote: |
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(1,49,81:C'01')
OUTREC FIELDS=(1,16,(17,9,ZD,ADD,50,02,ZD),EDIT=(TTTTTTTTT),26,24)
|
part in bold should be 81,2,ZD
You are gettinh SOC7 bz at 50,2 there is no number |
|
| Back to top |
|
 |
Guru Prasath
New User

Joined: 04 Jun 2008 Posts: 36 Location: Chennai
|
|
|
|
Hi Enrico,
Sorry for my poor understanding..
I have tried the below one. i just changed to ZDF and it worked fine.
INREC OVERLAY=(17:17,9,ZD,ADD,+1,TO=ZDF,LENGTH=9) |
|
| Back to top |
|
 |
Guru Prasath
New User

Joined: 04 Jun 2008 Posts: 36 Location: Chennai
|
|
|
|
Sambhaji,
As you suggested, i have changed that to 81. this time the job went fine but still i am getting the low-values from 50 to 80th position.
Thanks,
Guru |
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
| Quote: |
As you suggested, i have changed that to 81. this time the job went fine
|
Good to know that you have come out of SOC7
| Quote: |
but still i am getting the low-values from 50 to 80th position.
|
That is because you are only writing 49 char in output. You have to write all 80 chars.
as below
INREC OVERLAY=(1,49,81:C'01')
OUTREC FIELDS=(1,16,(17,9,ZD,ADD,81,02,ZD),EDIT=(TTTTTTTTT),26,55) |
|
| Back to top |
|
 |
Guru Prasath
New User

Joined: 04 Jun 2008 Posts: 36 Location: Chennai
|
|
|
|
Sorry Sambhaji,
As suggested, i have tried but the result is same. Still i am getting low-values.
One more thing, as i told i have modified Frank's sort card as:
INREC OVERLAY=(17:17,9,ZD,ADD,+1,TO=ZDF,LENGTH=9)
this also gives low-values.
Thanks,
Guru |
|
| Back to top |
|
 |
Escapa
Senior Member

Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
That means your input file itself has low values...
If you want spaces you have to put spaces explicitly like
OUTREC FIELDS=(1,16,(17,9,ZD,ADD,81,02,ZD),EDIT=(TTTTTTTTT),26,8,47X)
here i have assumed that you have valid 8 char data after counter and you want spaces after that till 80th column. |
|
| Back to top |
|
 |
Guru Prasath
New User

Joined: 04 Jun 2008 Posts: 36 Location: Chennai
|
|
|
|
Yes sambhaji,
Your previous solutions itself solved worked fine.
It just accumulated from your previous solutions.
Also, Frank's solution too worked fine.
Thanks for all your effort.
Thanks,
Guru. |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
Guru,
Did you notice that Frank's solution did not pad the input file at the end whereas Sambaji's solution did. Padding at the end should NOT be done for VB files. By doing so one's just ignoring the very purpose of using a VB file. |
|
| Back to top |
|
 |
Guru Prasath
New User

Joined: 04 Jun 2008 Posts: 36 Location: Chennai
|
|
|
|
Arun,
Are you talking about my input file? its FB...Not VB |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
| Guru Prasath wrote: |
Hi,
I caught with this case in production..
.............................
.............................
counter file starts from the 17theh position . record format is VB of length 80.
Thanks,
Guru. |
This is what your initial post says. This topic has grown to the next page and you never mentioned your requirement got changed !!!. I believe these are some of the critical info. that you should mention clearly. |
|
| Back to top |
|
 |
Guru Prasath
New User

Joined: 04 Jun 2008 Posts: 36 Location: Chennai
|
|
|
|
Yes,
this is my mistake. So many i read the post...i dont know how i missed it?
sorry again.
Thanks for pointing this.
This will not happen again. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|