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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Hi, can any one provide the solution for this,,,
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 Moderator


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

PostPosted: Sat Apr 30, 2005 9:27 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Sat Apr 30, 2005 10:28 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Need help in design the solution ritnihi PL/I & Assembler 1 Tue Dec 22, 2015 1:48 pm
No new posts Does SORT provide LRECL in programming? jacobdng DFSORT/ICETOOL 5 Fri Mar 20, 2015 12:50 pm
No new posts Please give me solution(OUTPUT ) for ... sivareddy123 COBOL Programming 4 Mon Feb 02, 2015 1:33 pm
No new posts Delimited File -Unable to Find solution Dimpy Udhani JCL & VSAM 7 Mon Nov 24, 2014 11:40 am
No new posts MQ Solution Designer Certification Appu IBM Tools 0 Mon Jul 07, 2014 11:25 am


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