IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Suggestion for overlay command


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
SENTHIL MURUGAAN
Warnings : 1

New User


Joined: 12 Jan 2013
Posts: 32
Location: India

PostPosted: Tue Jul 23, 2013 3:29 pm
Reply with quote

Hi,

I have the data as below.
Code:

ABV 01   
BCA     
CHG     
DCA     
SUB 02
abc     
DTA 03
abc     
efg     


In the above i need to add sequence nos to be written in (8:6) position when the sequence no present in (5:2) changes as shown below to be done in sort card. (5:2) will be in sorted order.
Code:

ABV 01 01
BCA    02
CHG    03
DCA    04
SUB 02 01
abc    02
DTA 03 01
abc    02
efg    03


Can anyone pls provide me sample for the above.

Thanks,
Senthil Murugaan
Back to top
View user's profile Send private message
xknight

Active User


Joined: 22 Jan 2008
Posts: 117
Location: Liberty city

PostPosted: Tue Jul 23, 2013 3:35 pm
Reply with quote

Hello,

I am sure it would be much helpful if you could post/edit your query (given data & expected data) in the code'd format.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Jul 23, 2013 3:36 pm
Reply with quote

Please learn to use the code tags when posting to make your post more helper friendly

Code:
[code]
Your
stuff
goes
here
[/code]
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Jul 23, 2013 3:48 pm
Reply with quote

Senthil,

For the data what you have shown here, if the requirement can also be stated like "assign a 2-byte sequence number at pos-8 and restart it whenever there is a non-blank value exists at pos-5,2", you could try this.
Code:
//SORT01   EXEC  PGM=SORT                                       
//SYSOUT   DD  SYSOUT=*                                         
//SORTIN   DD  *                                                 
ABV 01                                                           
BCA                                                             
CHG                                                             
DCA                                                             
SUB 02                                                           
abc                                                             
DTA 03                                                           
abc                                                             
efg                                                             
//*                                                             
//SORTOUT  DD  SYSOUT=*                                         
//SYSIN    DD  *                                                 
  SORT FIELDS=COPY                                               
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(5,2,CH,NE,C' '),PUSH=(8:SEQ=2))
SORTOUT had this:
Code:
ABV 01 01
BCA    02
CHG    03
DCA    04
SUB 02 01
abc    02
DTA 03 01
abc    02
efg    03
Back to top
View user's profile Send private message
SENTHIL MURUGAAN
Warnings : 1

New User


Joined: 12 Jan 2013
Posts: 32
Location: India

PostPosted: Tue Jul 23, 2013 4:18 pm
Reply with quote

Hi Arun,

The position (5:2) can have spaces so the above method will not work properly.

So cosider below data. If (1:3) = 'SUB' or 'DPT', then sequence no must be restarted. any way to achieve this. suppose if both SUB & DPT present continuous then SUB must be first sequence followed by DPT.

Code:
DPT 01 01
BCA 02
CHG 03
DCA 04
SUB 02 01
DPT 02
ABC 03
SUB 03 01
ABC 02
EFG 03

Output:
Code:
DPT 01 01
BCA 02
CHG 03
DCA 04
SUB 02 01
DPT 02
ABC 03
SUB 03 01
ABC 02
EFG 03
Back to top
View user's profile Send private message
xknight

Active User


Joined: 22 Jan 2008
Posts: 117
Location: Liberty city

PostPosted: Tue Jul 23, 2013 4:41 pm
Reply with quote

Hello,

Quote:
The position (5:2) can have spaces so the above method will not work properly.


Are you telling this based on the executed job output or with your assumption.

Did you tried executing the given snippet. If you still face issues post the used snippet & received output.

Expat has explained clearly how to use code tag on your post. Please get used with it.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Jul 23, 2013 4:41 pm
Reply with quote

SENTHIL MURUGAAN

You have been asked to use code tags, and shown how to do this.
If you can not be bothered to help those trying to help you, why should we bother icon_evil.gif

Have you tried Aruns suggestion before saying that it will not work ,or is it just a case that you have decied to add further information to the post that should have been included initially.
Back to top
View user's profile Send private message
SENTHIL MURUGAAN
Warnings : 1

New User


Joined: 12 Jan 2013
Posts: 32
Location: India

PostPosted: Tue Jul 23, 2013 5:01 pm
Reply with quote

Hi,

The file what i have didnt hold spaces at the specified position(5:2). But it can hold values other than spaces when i noticed the copybook. The file is created by copybook that holds multiple layouts. So i am trying to say that i need to approach a different way to generate sequence no and I am not saying that arun is wrong.

Thanks,
Senthil
Back to top
View user's profile Send private message
xknight

Active User


Joined: 22 Jan 2008
Posts: 117
Location: Liberty city

PostPosted: Tue Jul 23, 2013 5:24 pm
Reply with quote

Hello,

Is there any differences between input & output

Code:
Code:
DPT 01 01
BCA 02
CHG 03
DCA 04
SUB 02 01
DPT 02
ABC 03
SUB 03 01
ABC 02
EFG 03

Output:
Code:
DPT 01 01
BCA 02
CHG 03
DCA 04
SUB 02 01
DPT 02
ABC 03
SUB 03 01
ABC 02
EFG 03


If you able to post your queries in detail you would get the help in return.

Post the input & expected output clearly. (Code tag it)
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Jul 23, 2013 6:16 pm
Reply with quote

Senthil,

As already pointed out, the sample input and expected output in your latest post are the SAME.

If your requirement is different from what you posted initially, please start over and post a few sample input records
covering all possible input scenarios and the expected output out of it (enclosed by "Code" tags).
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Routing command Address SDSF to other... TSO/ISPF 2
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
No new posts LTJ command CA Products 4
No new posts Query on edit primary command CLIST & REXX 5
Search our Forums:

Back to Top