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

Hi, can any one provide the solution for this,,,


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

New User


Joined: 30 Apr 2005
Posts: 2
Location: Bangalore

PostPosted: Sat Apr 30, 2005 5:38 pm
Reply with quote

Hi every body,
I have a problem while copying and formatting a PS into another PS file. I would like to explain my problem description in detail :

I have a flat file of length 939 which contains one Header, some Data records and finally the Trailer record. They look for suppose like this,,

111CR32000720134996 000043596315002 EA0
CR111 32000720134996 00008QF50DB EA0
CR111 32000126102457AA NNN1USDP2LVRXPD2
CR111 32000126102457AA 00001CATTH2221SS 0
CR111 32000126102457AA 00002CATA2K20R 0
111CR32000720134996

Now my main problem is,, if you look in to the above file,, the Header and Trailer records contains in First 3 positions as 111 ,,, whereas the Data records(meaning 2 record till the record before the Trailer has the same 111 value in positions 4 to 6. Now I need to copy this PS file into another PS file without the loss of data and format just replacing 111 with 222.Also I would like to confirm one more thing here that the value 111 is not present at any other positions other than explained here. Can this be done in a single SORT Step? If so, can someone help provide the answer for this please. This is a quiet an urgent for me.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Sat Apr 30, 2005 9:27 pm
Reply with quote

Here's a DFSORT job that will do what I think you want. OUT will contain the records with 111 changed to 222. If 111 is not present at another position, ERR will be empty. If 111 is present at another position, ERR will have the record(s) in which 111 is at another position.

The only variation it won't catch is when a '111CR' or 'CR111' record is out of order (e.g. the third record is a 111CR record or the last record is a CR111 record). Do you need that variation caught as well?

I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

Note that you'll need z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004) to use DFSORT's new IFTHEN and OVERLAY functions. If you have DFSORT, but you don't have the Dec, 2004 PTF, ask your System Programmer to install it. If you don't have DFSORT, you can't use the IFTHEN or OVERLAY funcitons (other sort products don't have them).

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//OUT  DD DSN=...    output file (FB/80)
//ERR  DD DSN=...    error file (FB/80)
//SYSIN    DD    *
  OPTION COPY
* Change '111' to '222' as needed.
  INREC IFTHEN=(WHEN=(1,5,CH,EQ,C'111CR',AND,6,1,CH,NE,C' '),
         OVERLAY=(1:C'222')),
       IFTHEN=(WHEN=(1,6,CH,EQ,C'CR111'),OVERLAY=(3:C'222'))
* OUT -> Records with '111' changed to '222'.
  OUTFIL FNAMES=OUT
* ERR -> EMPTY if '111' not found out of position.
*     -> NOT EMPTY if '111' found out of position.
  OUTFIL FNAMES=ERR,INCLUDE=(1,80,SS,EQ,C'111')
/*
Back to top
View user's profile Send private message
somasundaran_k

Active User


Joined: 03 Jun 2003
Posts: 134

PostPosted: Sat Apr 30, 2005 9:54 pm
Reply with quote

Frank
Is it not the file names are OUT and ERR instead of OUT1 and OUT2 in your expalnation?
Looks like a typo icon_lol.gif

Regds
-Som
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Sat Apr 30, 2005 10:28 pm
Reply with quote

Som,

Yes, I changed the names in the job to make them more meaningful but forgot to change the explanation. I've edited my post to fix it. Thanks for pointing it out.
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 SDSF like solution in EJES (store com... All Other Mainframe Topics 4
No new posts A very ingenious mainframe automation... CA Products 1
No new posts Typing the CENT sign ยข on mainframe,... All Other Mainframe Topics 2
No new posts Any single step solution possible? SYNCSORT 7
This topic is locked: you cannot edit posts or make replies. CICS availability solution CICS 17
Search our Forums:

Back to Top