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

Query on PUSH


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 161
Location: South Africa

PostPosted: Thu May 30, 2013 6:34 pm
Reply with quote

Hi,

I have a below sort card and apparently in my file only I always get only one group of records which satisfies the below WHEN=GROUP and from that I am able to find the below include condition which gives me one group.
But my query is if there are multiple groups which fullfill the below scenario then how my INCLUDE will work.
Code:
*TEST1                                                         
 OPTION COPY                                                   
 INREC IFTHEN(WHEN=GROUP,                                       
                 BEGIN=(1,2,CH,EQ,C'01',AND,92,2,CH,EQ,C'99'), 
                 END=(1,2,CH,EQ,C'99'),                         
                 PUSH=(251:ID=2))                               
 OUTFIL INCLUDE(251,2,CH,EQ,C'01'),                             
                 BUILD=(1,250)       



I tried the below but iit gives me syntax error. Can't we do same in PUSH as we can do in OVERLAY=(251:C'VALID')
Code:
 PUSH=(251:C'VALID'))       
            OUTFIL INCLUDE(251,5,CH,EQ,C'VALID')
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu May 30, 2013 6:39 pm
Reply with quote

How about posting the SYSOUT telling what, where the syntax error occurs

Psychic day was Tuesday this week
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 161
Location: South Africa

PostPosted: Thu May 30, 2013 6:52 pm
Reply with quote

Good Day,
I tried the below code:
Code:
//SYSIN    DD *                                                         
*GET THE GROUP OF RECORDS WHICH HAS 01 AND 99 AT POSITIONS             *
*01 AND 92 RESPECTIVELY ON HEADER AND 99 AT POSITION 01 ON TRAILER     *
 OPTION COPY                                                           
 INREC IFTHEN(WHEN=GROUP,                                               
                 BEGIN=(1,2,CH,EQ,C'01',AND,92,2,CH,EQ,C'99'),         
                 END=(1,2,CH,EQ,C'99'),                                 
                 PUSH=(251:C'VALID'))                                   
 OUTFIL INCLUDE(251,5,CH,EQ,C'VALID'),                                 
                 BUILD=(1,250)                                         
//*                                                                   



and the spool is:

Code:
1ICE805I 1 JOBNAME: XXXXRTCL , STEPNAME: SRT01#22
 ICE802I 0 BLOCKSET     TECHNIQUE IN CONTROL
 ICE007A 1 SYNTAX ERROR
 ICE751I 0 C5-K76982 C6-K90026 C7-K58148 C8-K67572 E7-K79990
 ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED
 ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE
 ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 15:16 ON THU MAY 30, 2013 -
0          *GET THE GROUP OF RECORDS WHICH HAS 01 AND 99 AT POSITIONS             *
           *01 AND 92 RESPECTIVELY ON HEADER AND 99 AT POSITION 01 ON TRAILER     *
            OPTION COPY
            INREC IFTHEN(WHEN=GROUP,
                            BEGIN=(1,2,CH,EQ,C'01',AND,92,2,CH,EQ,C'99'),
                            END=(1,2,CH,EQ,C'99'),
                            PUSH=(251:C'VALID'))
                                       $
 ICE007A 1 SYNTAX ERROR
            OUTFIL INCLUDE(251,5,CH,EQ,C'VALID'),
                            BUILD=(1,250)
 ICE751I 0 C5-K76982 C6-K90026 C7-K58148 C8-K67572 E7-K79990
 ICE052I 3 END OF DFSORT


Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu May 30, 2013 6:53 pm
Reply with quote

If I am correct Push doesnt allow C'<BLAH>'

Quote:
You can use the following in PUSH:
c: Specifies the output position (column) to be overlaid. If you do not
specify c: for the first item, it defaults to 1:. If you do not specify c:
for any other item, it starts after the previous item. You can specify
items in any order and overlap output columns. c can be 1 to
32752.
If you specify an item that extends the output record beyond the
end of the input record, the record length is automatically
increased to that length, and blanks are filled in on the left as
needed. For variable-length records, the RDW length is increased
to correspond to the larger record length after all of the items are
processed. Missing bytes in specified input fields are replaced with
blanks so the padded fields can be processed.
p,m
Specifies a field in the first input record of each group to be
propagated to every record of the group. p specifies the starting
position of the field in the input record and m specifies its length.
A field must not extend beyond position 32752.
ID=n
Specifies a ZD identifier of length n is to be added to every record
of each group. The identifier starts at 1 for the first group and is
incremented by 1 for each subsequent group. n can be 1 to 15.
SEQ=n
Specifies a ZD sequence number of length n is to be added to
every record of each group. The sequence number starts at 1 for
the first record of each group and is incremented by 1 for each
subsequent record of the group. n can be 1 to 15.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu May 30, 2013 10:58 pm
Reply with quote

abhijit.nayak01 wrote:
Can't we do same in PUSH as we can do in OVERLAY=(251:C'VALID')


You have been spoon fed many times about reading the documentation and yet you never pay attention to that. You could have looked the syntax of PUSH by now and understood how different it is from OVERLAY.

Here is the link to the documentation once again. Scroll down to the section WHEN=GROUP clause

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ice1ca60/3.15



abhijit.nayak01 wrote:

But my query is if there are multiple groups which fullfill the below scenario then how my INCLUDE will work.


If you are pushing the id at the end why bother checking for '01'? Think logically and understand what is in positions 251 and you can code an include/omit condition to handle any number of groups.
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 161
Location: South Africa

PostPosted: Thu May 30, 2013 11:21 pm
Reply with quote

Thanks Pandora for your inputs.
The ID can be only vary from 1-15 which makes the below code working:
Code:
                PUSH=(251:ID=2))                       
OUTREC IFTHEN(WHEN=(251,2,ZD,LE,15,AND,251,2,ZD,GT,0), 
    OVERLAY=(251:C'00'))                               
OUTFIL INCLUDE(251,2,CH,EQ,C'00'),                     
BUILD=(1,250)                                           
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 161
Location: South Africa

PostPosted: Thu May 30, 2013 11:25 pm
Reply with quote

Hi Skolusu,
I was actually doing some trial and error method. Thanks to you, Bill and the team for making me comfortable to the DFSORT.
Thanks again.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu May 30, 2013 11:39 pm
Reply with quote

abhijit.nayak01 wrote:
Hi Skolusu,
I was actually doing some trial and error method. Thanks to you, Bill and the team for making me comfortable to the DFSORT.

The ID can be only vary from 1-15 which makes the below code working:
Thanks again.


*Sigh* So if for some reason you have more than 15 groups your job would fail? You need to code solutions that accounts for ALL possible scenarios. Just so you know , you don't need that IFTHEN OVERLAY to check if the group number is between 1 and 15. It is as simple as this.
Code:

//SYSIN   DD *
  OPTION COPY                                                           
  INREC IFTHEN(WHEN=GROUP,                                               
                  BEGIN=(1,2,CH,EQ,C'01',AND,92,2,CH,EQ,C'99'),         
                  END=(1,2,CH,EQ,C'99'),                                 
                  PUSH=(251:ID=1))               
                   
  OUTFIL BUILD=(1,250),INCLUDE=(251,1,CH,GT,C' ')
//*


This will take care of any number of groups you might have. Understand the control cards you are given and refer the manuals.
Back to top
View user's profile Send private message
abhijit.nayak01

Active User


Joined: 22 Mar 2009
Posts: 161
Location: South Africa

PostPosted: Fri May 31, 2013 12:41 am
Reply with quote

Hi Skolusu,

Quote:
The identifier starts at 1 for the first group and is
incremented by 1 for each subsequent group. n can be 1 to 15.
SEQ=n


I thought the ID can vary from 1 to 15. But it is n.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri May 31, 2013 1:03 am
Reply with quote

abhijit.nayak01 wrote:
Hi Skolusu,

Quote:
The identifier starts at 1 for the first group and is
incremented by 1 for each subsequent group. n can be 1 to 15.
SEQ=n


I thought the ID can vary from 1 to 15. But it is n.

Wrong; the length of the ID can vary from 1 to 15; the value of the ID can vary from 1 to 10^n-1.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri May 31, 2013 2:41 am
Reply with quote

abhijit.nayak01 wrote:
Hi Skolusu,

Quote:
The identifier starts at 1 for the first group and is
incremented by 1 for each subsequent group. n can be 1 to 15.
SEQ=n


I thought the ID can vary from 1 to 15. But it is n.


So you coded the OVERLAY statement thinking that the value of ID can only be just 15? WOW.

As Akatsukami explained it is the LENGTH not the VALUE

ID=15 will produce a number in the format

Code:

----+----1----+
000000000000001
000000000000002
000000000000003
000000000000004
...
999999999999999


ID=1 will produce a number in the format

Code:

1
2
3
4
5
6
7
8
9
0
1
2
3
..
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Issue with EXEC CICS QUERY SECURITY c... CICS 6
Search our Forums:

Back to Top