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

Store Previos record value


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

New User


Joined: 20 Mar 2009
Posts: 25
Location: hyderabad

PostPosted: Wed Oct 28, 2009 10:15 am
Reply with quote

Hi,

Is there any way to store previous record value thru sort/syncort/icetool???

Input file
CH-LoBX(2) A-monthX(2)
01 02
02 03

output file
if CH-LOB not equal to 02 then A-month = X-month
else previous A-month = X-month

OUTPUT fILE
CH-LoBX(2) A-monthX(2) X-monthX(2)
01 02 02
02 03 02

Can anybody help me on this???
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Wed Oct 28, 2009 12:22 pm
Reply with quote

Please state which sort product that you are actually using, DFSORT, SYNCSORT or CA-SORT, as the solution may vary from product to product and it would be rather unfair for someone to provide you an answer that would not work with the software that you have installed.
Back to top
View user's profile Send private message
nazia.lalani
Warnings : 1

New User


Joined: 20 Mar 2009
Posts: 25
Location: hyderabad

PostPosted: Wed Oct 28, 2009 12:31 pm
Reply with quote

DFSORT, SYNCSORT or ICETOOL anything would work for me...
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Oct 28, 2009 7:56 pm
Reply with quote

Hello,

Quote:
anything would work for me...
I suspect that "anything" might work, but you most likely do not have all of the sort products installed.

You need to post which sort product(s) are installed and which releases of them so as to not waste multiple people's time. . .
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed Oct 28, 2009 8:56 pm
Reply with quote

nazia.lalani,

Assuming you have DFSORT the following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD *                                                   
0102                                                             
0203                                                             
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                   
  SORT FIELDS=COPY                                               
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,2,CH,NE,C'02'),PUSH=(5:3,2)) 
//*


The output of this is

Code:

010202
020302
Back to top
View user's profile Send private message
nazia.lalani
Warnings : 1

New User


Joined: 20 Mar 2009
Posts: 25
Location: hyderabad

PostPosted: Thu Oct 29, 2009 5:15 pm
Reply with quote

Hi sri

When I tried the solution given by you I m getting syntax error
Will group function not work for Z/OS 1.2.3.1R????
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Oct 29, 2009 6:30 pm
Reply with quote

expat wrote:
Please state which sort product that you are actually using, DFSORT, SYNCSORT or CA-SORT, as the solution may vary from product to product and it would be rather unfair for someone to provide you an answer that would not work with the software that you have installed.

My guess is that you have SYNCSORT installed and have, despite being asked not to, allowed one of the DFSORT guys to give you a solution that will not work using SYNCSORT icon_evil.gif

This is why I wrote my original response above.

Please post the error messages and codes issued and maybe someone will be able to help you resolve this.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Oct 29, 2009 9:12 pm
Reply with quote

Hello,

Quote:
Will group function not work for Z/OS 1.2.3.1R????
Yes, it will not work with that release of Syncsort.

If your system is upgraded to the current release of Syncsort, GROUP should work. . .
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 Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top