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
 

 

Writing the new counter file to another file?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Guru Prasath

New User


Joined: 04 Jun 2008
Posts: 36
Location: Chennai

PostPosted: Mon Oct 06, 2008 8:43 pm    Post subject: Writing the new counter file to another file?
Reply with quote

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
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Oct 06, 2008 10:12 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Mon Oct 06, 2008 10:39 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Guru Prasath

New User


Joined: 04 Jun 2008
Posts: 36
Location: Chennai

PostPosted: Tue Oct 07, 2008 10:15 am    Post subject: Reply to: Writing the new counter file to another file?
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Oct 07, 2008 11:29 am    Post subject:
Reply with quote

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. icon_sad.gif icon_sad.gif
Back to top
View user's profile Send private message
Guru Prasath

New User


Joined: 04 Jun 2008
Posts: 36
Location: Chennai

PostPosted: Tue Oct 07, 2008 11:37 am    Post subject: Reply to: Writing the new counter file to another file?
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Oct 07, 2008 11:48 am    Post subject:
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Oct 07, 2008 11:55 am    Post subject:
Reply with quote

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
View user's profile Send private message
Guru Prasath

New User


Joined: 04 Jun 2008
Posts: 36
Location: Chennai

PostPosted: Tue Oct 07, 2008 12:22 pm    Post subject: Reply to: Writing the new counter file to another file?
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Oct 07, 2008 12:25 pm    Post subject:
Reply with quote

What is LRECL of your file?
Code:

INREC OVERLAY=(1,49,[i](here you should use lrecl+1)[/i]:C'01')
Back to top
View user's profile Send private message
Guru Prasath

New User


Joined: 04 Jun 2008
Posts: 36
Location: Chennai

PostPosted: Tue Oct 07, 2008 12:30 pm    Post subject: Reply to: Writing the new counter file to another file?
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Tue Oct 07, 2008 12:30 pm    Post subject: Reply to: Writing the new counter file to another file?
Reply with quote

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 icon_mad.gif

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Oct 07, 2008 12:32 pm    Post subject:
Reply with quote

Post your whole step here..
Back to top
View user's profile Send private message
Guru Prasath

New User


Joined: 04 Jun 2008
Posts: 36
Location: Chennai

PostPosted: Tue Oct 07, 2008 12:45 pm    Post subject: Reply to: Writing the new counter file to another file?
Reply with quote

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?icon_redface.gif

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Oct 07, 2008 12:49 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Guru Prasath

New User


Joined: 04 Jun 2008
Posts: 36
Location: Chennai

PostPosted: Tue Oct 07, 2008 12:57 pm    Post subject: Reply to: Writing the new counter file to another file?
Reply with quote

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
View user's profile Send private message
Guru Prasath

New User


Joined: 04 Jun 2008
Posts: 36
Location: Chennai

PostPosted: Tue Oct 07, 2008 12:58 pm    Post subject: Reply to: Writing the new counter file to another file?
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Oct 07, 2008 2:17 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Guru Prasath

New User


Joined: 04 Jun 2008
Posts: 36
Location: Chennai

PostPosted: Tue Oct 07, 2008 2:43 pm    Post subject: Reply to: Writing the new counter file to another file?
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Oct 07, 2008 3:11 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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