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
 

 

Suggestion for overlay command

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
SENTHIL MURUGAAN
Warnings : 1

New User


Joined: 12 Jan 2013
Posts: 28
Location: India

PostPosted: Tue Jul 23, 2013 3:29 pm    Post subject: Suggestion for overlay command
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Tue Jul 23, 2013 3:36 pm    Post subject:
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: 2164
Location: @my desk

PostPosted: Tue Jul 23, 2013 3:48 pm    Post subject:
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: 28
Location: India

PostPosted: Tue Jul 23, 2013 4:18 pm    Post subject: suggestion for overlay command
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Tue Jul 23, 2013 4:41 pm    Post subject:
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: 28
Location: India

PostPosted: Tue Jul 23, 2013 5:01 pm    Post subject:
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    Post subject:
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: 2164
Location: @my desk

PostPosted: Tue Jul 23, 2013 6:16 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts DB2 SQL help/idea/suggestion bshkris DB2 4 Thu Oct 06, 2016 3:04 pm
No new posts SDSF Command Avtrix CLIST & REXX 4 Fri Sep 30, 2016 11:13 am
No new posts How to find a CICS resource used in C... Arunkumar Chandrasekaran CICS 8 Thu Sep 29, 2016 1:45 pm
No new posts COMPARE command sivatechdrive TSO/ISPF 7 Fri Sep 16, 2016 4:31 pm


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