View previous topic :: View next topic
|
Author |
Message |
rkprasanth_m
New User
Joined: 22 Jun 2006 Posts: 44
|
|
|
|
I have a requirement to intilize two fileds CHAR, nad PACKED DECIMAL.
Would someone please assist on this.. |
|
Back to top |
|
|
manihcl85 Warnings : 1 New User
Joined: 11 Jan 2007 Posts: 52 Location: chennai
|
|
|
|
Hi,
can u give in brief what ur actual requirment was.
Regards,
Mani |
|
Back to top |
|
|
rkprasanth_m
New User
Joined: 22 Jun 2006 Posts: 44
|
|
|
|
My requirement is I have added 2 new fields x(02) and S9(03)v99 comp-3. I will ahve to intilize all these fields using a quick batch program, probable using SORT statements.
So I want those sort statements..and sytex if possable |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Initialize to what? What is the starting position of each field? Are the VSAM record fixed length or variable length? |
|
Back to top |
|
|
rkprasanth_m
New User
Joined: 22 Jun 2006 Posts: 44
|
|
|
|
It's a variable length VSAM.
Starting position of field 1 = 452, length = 2, PIC X(02)
Startign position of field 2 = 454, length = 3, PIC S999v99 comp-3
And Condition is (starting position = 39, length = 2, PIC X(02)) = '10'
The above two fields Occurs 5 times
Thanks.. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
It's still not clear what you want to do which makes it difficult to help you.
What is the "condition" used for? Do you only want to initialize fields in records with that condition, or do you want to use the condition for something else.
You still haven't told us what values you want to use to initialize field1 and field2. Do you want to initialize field1 to '00' or spaces or what? Do you want to initialize field2 to PD 0 or something else?
What do you mean by "the above two fields occurs 5 times"? Do field1 and field2 occur 5 times in each record starting at position 452 or what? |
|
Back to top |
|
|
rkprasanth_m
New User
Joined: 22 Jun 2006 Posts: 44
|
|
|
|
Please find below my answers
It's a variable length VSAM.
Starting position of field 1 = 452, length = 2, PIC X(02)
Wanted to initialize to SPACES
Startign position of field 2 = 454, length = 3, PIC S999v99 comp-3
Wanted to initialize to ZEROS
And Condition is (starting position = 39, length = 2, PIC X(02)) = '10'
Only I wanted to initialize the fields of a particular records which meets the condition above.
The above two fields Occurs 5 times
Above two fields comes under one group which occurs 5 times.
One more quistion..I haven't added 4 bytes to starting positions, scince this is VSAM file, I doubt we may need to add 4 to starting position.
Thanks.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Please post some real data that currently exists and show what you want the result to look like. You need to specify the starting position of each of the fields you want to initialize - all 10 of them. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
rkprasanth_m,
If I understand correctly what you want to do, then this DFSORT job will do what you asked for. Since this is a variable-length VSAM file, you must add +4 to the starting positions and specify TYPE=V.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (VSAM V)
//SORTOUT DD DSN=... output file
//SYSIN DD *
RECORD TYPE=V
OPTION COPY
INREC IFTHEN=(WHEN=(43,2,CH,EQ,C'10'),
OVERLAY=(456:5X'404000000C'))
/*
|
|
|
Back to top |
|
|
|