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

How to find non-blank character in a column and to change it


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
i413678
Currently Banned

Active User


Joined: 19 Feb 2005
Posts: 112
Location: chennai

PostPosted: Mon May 28, 2007 1:35 pm
Reply with quote

Hi,

My requirement is as follows:

I have one input file with first 10bytes as the key.

Input Data in the first 10 bytes is as follows:
ABCDEADJ01
ABCDEADJ02
ABCDEADJ03
ABCDEADJ04
ABCDEADJ05
ABCDEAFK01
ABCDE4NPAA
ABCDE4NPAB
ABCDE4NPAC
ABCDE4NPAD
ABCDE4NPAE

Now my requirement is I want to maintain the key as first 10 bytes only but I want the data as follows:
ABDEADJ001
ABDEADJ002
ABDEADJ003
ABDEADJ004
ABDEADJ005
ABDEAFK001
ABDE4NPAA
ABDE4NPAB
ABDE4NPAC
ABDE4NPAD
ABDE4NPAE

The actual requirement is as follows:
1. I want to change first 5 bytes to 4 bytes only..............
i.e. ABCDE will change to ABDE
2. I want to add 8th character as follows
if 9th byte has numeric value I should populate 8th byte as zero and
if 9th byte has character No need to populate any thing in 8th byte but I should move 9th and 10th characters to 8th and 9th positions and 10th character should be space.

Please Note : Previously the key is 5,5 after requirement it should change to 6,4.............

I hope you understood my requirement.

May I know whether it can be done using JCL 3.4 commands or using any JCL sort or any other way to do this......

Thx in advance..........

pavan
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon May 28, 2007 2:04 pm
Reply with quote

Pavan,

The following SORT CARD might do the trick for you. Please remeber this card is not tested.

Code:

//SYSIN DD *
  INREC FIELDS=(1,2,    * FIRST 2 CHARACTERS
                4,5,    * SKIP OUT 3 CHARACTER AND START FRM 4
                C' ',   * BLANK OUT 8th POS TEMPROARILY
                9,n)   * WHERE n=LRECL-8

  SORT FIELDS=COPY

  OUTREC IFTHEN=(WHEN=(9,1,FS,EQ,NUM),
                OVERLAY=(8:C'0'))
         IFTHEN=(WHEN=(9,1,FS,NE,NUM),
                OVERLAY=(8:9,2,        * MOVE 9, 10 POS to 8, 9 Pos
                         10:C' ')      * BLANK OUT 10 COLUMN     
/*
Back to top
View user's profile Send private message
i413678
Currently Banned

Active User


Joined: 19 Feb 2005
Posts: 112
Location: chennai

PostPosted: Mon May 28, 2007 5:51 pm
Reply with quote

First of all thank for quick reply.

But, May I know is NUM is keyword to check numercis as I am getting the error when I am using this NUM.....

Please suggest...

pavan
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon May 28, 2007 7:25 pm
Reply with quote

yes NUM is a keyword.

Please paste the snapshot of the error that you are facing
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: Mon May 28, 2007 10:11 pm
Reply with quote

pavan,

You need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use DFSORT's NUM function. If you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:

Use [URL] BBCode for External Links

But since you posted in the JCL Forum rather than the DFSORT Forum, I assume you have Syncsort. not DFSORT. Syncsort doesn't support the NUM function.
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Tue May 29, 2007 8:33 pm
Reply with quote

I guess this should be enough in ISPF 3.4 options.
c all 'c' '' 3
c all '0' '00' 9.
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
No new posts Find the size of a PS file before rea... COBOL Programming 13
Search our Forums:

Back to Top